Structured Query Language (SQL)
Class 12 · Computer Science · 32 Questions
What are the minimum and maximum income values that can be entered in the income attribute given the data type is INT?
Define RDBMS. Name any two RDBMS software.
Site any two differences between Single Row Functions and Aggregate Functions.
What do you understand by Cartesian Product?
Differentiate between the following statements:
Write the name of the functions to perform the following operations:
Write the output produced by the following SQL statement: SELECT POW(2,3);
Write the output produced by the following SQL statement: SELECT ROUND(342.9234,-1);
Write the output produced by the following SQL statement: SELECT LENGTH("Informatics Practices");
Write the output produced by the following SQL statement: SELECT YEAR("1979/11/26"), MONTH("1979/11/26"), DAY("1979/11/26"), MONTHNAME("1979/11/26");
Write the output produced by the following SQL statement: SELECT LEFT("INDIA",3), RIGHT("Computer Science",4), MID("Informatics",3,4), SUBSTR("Practices",3);
Consider the following MOVIE table and write the SQL queries based on it. List MovieID, MovieName and Cost for all movies with ProductionCost greater than 10,000 and less than 1,00,000.
Suppose your school management has decided to conduct cricket matches between students of Class XI and Class XII. Students of each class are asked to join any one of the four teams – Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer vacations, various matches will be conducted between these teams. Help your sports teacher to do the following: Create a database “Sports”.
Create a table “TEAM” with following considerations:
Using table level constraint, make TeamID as the primary key.
Show the structure of the table TEAM using a SQL statement.
As per the preferences of the students four teams were formed as given below. Insert these four rows in TEAM table: Row 1: (1, Team Titan) Row 2: (2, Team Rockers) Row 3: (3, Team Magnet) Row 3: (4, Team Hurricane)
Show the contents of the table TEAM using a DML statement.
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the queries for the following: Display the MatchID of all those matches where both the teams have scored more than 70.
Using the sports database containing two relations (TEAM, MATCH_DETAILS) and write the queries for the following: Display the MatchID of all those matches where FirstTeam has scored less than 70 but SecondTeam has scored more than 70.