0% found this document useful (0 votes)
11 views4 pages

SQL PDF

The document outlines a JavaScript test focused on SQL, detailing the creation of tables for countries, states, and cities, along with various operations such as adding columns, inserting data in different ways, updating records, and deleting entries. It also includes multiple queries to retrieve specific data from the tables based on various conditions. Overall, it serves as a comprehensive guide for SQL operations related to geographic entities.

Uploaded by

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

SQL PDF

The document outlines a JavaScript test focused on SQL, detailing the creation of tables for countries, states, and cities, along with various operations such as adding columns, inserting data in different ways, updating records, and deleting entries. It also includes multiple queries to retrieve specific data from the tables based on various conditions. Overall, it serves as a comprehensive guide for SQL operations related to geographic entities.

Uploaded by

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

JAVASCRIPT TEST – 2

(SQL – 24-07-2022)

1. Create table country


a. Countryid PK AI NN
b. Countryname NN
Create table state
a. Stateid PK AI NN
b. Countryid NN
c. Statename NN
Create table city
a. Cityid PK AI NN
b. Countryid NN
c. Stateid NN
d. Cityname NN
2. Add new column in table country
Picture NN after column countryname
Add new column in table state
Picture NN after column statename
Add new column in table city
Picture NN after column cityname
3. Write syntax for deleting database/schema/table. (2)
4. Insert data to table city in all possible ways
i. Without specifying column name
j. With specifying column name in sequential way
k. With specifying column name in unsequential way
l. Without specifying the auto generated field
5. Insert data to table country in all possible ways
m. Without specifying column name
n. With specifying column name in sequential way
o. With specifying column name in unsequential way
p. Without specifying the auto generated field
6. Insert data to table state in all possible ways
q. Without specifying column name
r. With specifying column name in sequential way
s. With specifying column name in unsequential way
t. Without specifying the auto generated field
7. Update all records of table city of picture by india.jpg whose cityname contains ur
8. Update all records of table city of picture by mp.jpg whose statename is Madhya
Pradesh
9. Update the records of state of column picture by india.jpg whose countryname is
india.
10. Update the records of city of column picture by up.jpg whose countryname is
india and statename is Uttar Pradesh.
11. Delete all records of table city whose cityid is 1,3,5,7,9 and countryname is
Australia.
12. Delete all the records of table city whose countryname is UK and statename is
England.

Country Table

State Table

City table
13. Show all columns of table city whose countryname is India
14. Show all columns of table city whose cityname contains op and stateid between
5 to 15.
15. Show all columns of table city whose statename is Madhya Pradesh
16. Show all columns of table city in the ascending order according to their cityname.
17. Show the count of all the cities according to their country.
18. Show all the columns of table city whose cityname second and third character
must be gr
19. Show all columns of table city whose countryname is india and statename is
Maharashtra.
20. Show all columns of city,statename of all the records.
21. Show all columns of city,statename, countryname of all the records.
22. Show cityid, cityname, picture, stateid, statename, picture, countryid,
countryname, picture of all the records of table city.
23. Show all columns of city whose countryname is Australia and statename is
queensland.
24. Show all columns of city whose countryname is India and statename is Madhya
Pradesh and Maharashtra
25. Show all columns of city, all columns of state, all columns of country whose
countryname is india.
26. Show cityname,statename,countryname of table city whose countryname second
character is n
27. Show cityname,cityid,statename,countryname whose countryname contains a
and statename contains h
28. Show all columns of city, statename whose statename having exact 11
characters.
29. Show all columns of city, statename,countryname whose statename having exact
11 characters and countryname starts with I

You might also like