Top 30 SQL Interview Questions for 2020

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO) in 1987. Raymond Boyce and...

SQL Truncate

This command deletes all records from table. Truncate is a DDL command. Syntax: TRUNCATE table table_name; 123  TRUNCATE table table_name;  Example: Truncate table teacher; 123  Truncate table teacher;  ORDER BY The ORDER BY clause arranges the...

SQL Operators

Arithmetic Operators Arithmetic operators are +, -, *, /, % performs addition, subtraction, multiplication, division, modulo respectively. Example:   Select 100+222; Select salary+100 From teacher Where teacher_id=1; Following output screen shows different arithmetic...

SQL Scalar Functions

TEACHER Table LCASE() Function The LCASE() function is used to return lower case values of specified column. Syntax: Select Lcase(column_name) from table_name; Example: Select Lcase(teacher_name) from teacher; Syntax: Select Lcase(column_name) from table_name [where...

SQL Aggregate Functions

Max() Function The Max() function returns the maximum value of specified column. Syntax: Select Max(column_name) From table_name; Example: Select Max(salary) From teacher; Min() Function The Min() function returns the minimum value of specified column. Syntax: Select...

SQL CONSTRAINTS

SQL Constraints specifies the rules/limitations/restrictions for data present in table. SQL Constraints are specified at the time of table creation or after table creation using ALTER command. There are two types of constraints column-level constraint and table-level...

SQL Data Control Language

Data Control Language decides to whom should (which user) permit access privileges. GRANT and REVOKE are the commands of DCL. GRANT: It gives privileges to user. REVOKE: It takes back privileges from granted user. Data Query Language Data Query Language does not make...

SQL Data Manipulation Language

Data Manipulation Language manipulates/make changes in data present in a table. It only affects data/records of table, not on the schema/structure of table. INSERT, UPDATE, DELETE are the commands of DML. INSERT: Stores data in a table or creates new records by...

SQL Data Definition Language

Data definition language directly effects on the structure/schema of the database. CREATE, ALTER, DROP are the commands of DDL. CREATE: Creates new database, table, or view of table. ALTER: Modifies the database or table. MODIFY, ADD keywords are used in altering data...

SQL Commands

SQL commands are classified into four groups on the basis of their nature. DDL (Data Definition Language) DML (Data Manipulation Language) DCL (Data Control Language) DQL (Data Query Language) NOTE: This symbol ‘[ ] ‘indicates optional. SQL is not a case sensitive...

Pin It on Pinterest