0% found this document useful (0 votes)
28 views3 pages

SQL Query Test Overview

This document contains answers to questions about SQL statements and syntax. It explains that SQL stands for Structured Query Language and covers statements for selecting, updating, deleting, and inserting data as well as basic syntax for where clauses with operators like =, BETWEEN, LIKE, AND, and OR. Joins, constraints, and creating tables are also covered.

Uploaded by

Vidhya hs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views3 pages

SQL Query Test Overview

This document contains answers to questions about SQL statements and syntax. It explains that SQL stands for Structured Query Language and covers statements for selecting, updating, deleting, and inserting data as well as basic syntax for where clauses with operators like =, BETWEEN, LIKE, AND, and OR. Joins, constraints, and creating tables are also covered.

Uploaded by

Vidhya hs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SQL INTERNAL QUERY TEST

[Link] does SQL stand for?


Answer: Structured Query Language
[Link] SQL statement is used to extract data from a database?
Answer:
The Select statement is used to extract data from a database
[Link] SQL statement is used to update data in a database?
Answer:
The UPDATE statement is used to change the existing data in a database.

[Link] SQL statement is used to delete data from a database?


Answer:
The drop statement is used to delete data from a database
5. Which SQL statement is used to insert new data in a database?
Answer:
The INSERT INTO statement is used to insert new records in a table.

[Link] SQL, how do you select a column named "FirstName" from a table named "Persons"?
Answer:
SELECT FirstName FROM Persons

[Link] SQL, how do you select all the columns from a table named "Persons"?
Answer:
SELECT * FROM Persons

[Link] SQL, how do you select all the records from a table named "Persons" where the value
of the column "FirstName" is "Peter"?
Answer:
SELECT * FROM Persons WHERE FirstName=’Peter’

[Link] SQL, how do you select all the records from a table named "Persons" where the value
of the column "FirstName" starts with an "a"?
Answer:
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
[Link] OR operator displays a record if ANY conditions listed are true. The AND operator
displays a record if ALL of the conditions listed are true. True or False?
Answer:
True
[Link] SQL, how do you select all the records from a table named "Persons" where the
"FirstName" is "Peter" and the "LastName" is "Jackson"?
Answer:
SELECT * FROM Persons WHERE FirstName=’Peter’ AND LastName=’Jackson’
[Link] SQL, how do you select all the records from a table named "Persons" where the
"LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
Answer:
SELECT * FROM Persons WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’
[Link] SQL statement is used to return only different values?
Answer:
SELECT DISTINCTstatement is used to return only different values

[Link] SQL, how can you insert a new record into the "Persons" table?
Answer:
INSERT INTO Persons VALUES (‘vidya’, ‘megha’)
[Link] SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
Answer:
INSERT INTO Persons (LastName) VALUES (‘Olsen’)
[Link] can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons
table?
Answer:
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
[Link] SQL, how can you delete the records where the "FirstName" is "Peter" in the
Persons Table?
Answer:
DELETE FROM Persons WHERE FirstName = ‘Peter’
[Link] is the most common type of join?
Answer:
The most common type of join is an INNER JOIN
[Link] operator is used to select values within a range?
Answer:
The BETWEEN operator is used in the where clause to select a value within a range of
values.
[Link] NOT NULL constraint enforces a column to not accept NULL values. True or False?
Answer:
True
[Link] operator is used to search for a specified pattern in a column?
Answer:
The LIKE operator is used in a where clause to search for a specified pattern in a column.
[Link] SQL statement is used to create a database table called 'Customers'?
Answer:
The CREATE TABLE statement is used to create a new table in a database.
[Link] SQL statement is used to delete the table Market from database?
Answer:
Delete query
[Link] constraints are used to relate tables?
Answer:
foreign key constraints to define relationships between tables

[Link] a query to create table Shopping with two columns as ID and Name. Name column
must be created with allowing duplicates and ID column must be created with avoiding null
values?
Answer:
CREAT TABLE SHOPPING(ID int NOT NULL,Name varchar(50) )
insert into SHOPPING values(1,’vidya’);
insert into SHOPPING values(2,’megha’);
select *From SHOPPING;

You might also like