SQL

  Home  Databases Programming  SQL


“SQL Interview Questions and Answers will guide us now that SQL (Structured Query Language) is a database computer language designed for managing data in relational database management systems (RDBMS), and originally based upon Relational Algebra. So learn SQL or get preparation for the job of SQL (Structured Query Language) with the help of this SQL Interview Questions with Answers guide”



172 SQL Questions And Answers

92⟩ Most important DDL statements in SQL are

CREATE TABLE - creates a new database table

ALTER TABLE - alters (changes) a database table

DROP TABLE - deletes a database table

CREATE INDEX - creates an index (search key)

DROP INDEX - deletes an index

 194 views

93⟩ SELECT statements

SELECT column_name(s) FROM table_name

SELECT DISTINCT column_name(s) FROM table_name

SELECT column FROM table WHERE column operator value

SELECT column FROM table WHERE column LIKE pattern

SELECT column,SUM(column) FROM table GROUP BY column

SELECT column,SUM(column) FROM table GROUP BY column HAVING SUM(column) condition value

Note that single quotes around text values and numeric values should not be enclosed in quotes. Double quotes may be acceptable in some databases.

 211 views

94⟩ The Delete Statements

DELETE FROM table_name WHERE column_name = some_value

Delete All Rows:

DELETE FROM table_name or DELETE * FROM table_name

 191 views

97⟩ The INSERT INTO Statements

INSERT INTO table_name VALUES (value1, value2,....)

INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)

 200 views

99⟩ What will be the output of following query?

What will be the output of the following query?

SELECT DECODE(TRANSLATE('A','1234567890','1111111111'), '1','YES', 'NO' );?

NO. Explanation :

The query checks whether a given string is a numerical digit.

 211 views