Download INDIAN SCHOOL AL WADI AL KABIR DEPARTMENT OF

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Concurrency control wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Database wikipedia , lookup

SQL wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

PL/SQL wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Clusterpoint wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Ingres (database) wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
INDIAN SCHOOL AL WADI AL KABIR
DEPARTMENT OF COMPUTER SCIENCE
REVISION QUESTION BANK – CLASS X – MY SQL
SECTION – A ( FILL IN THE BLANKS )
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
DDL stands for _________.
DML stands for _________.
_________ is the password to enter MySQL.
_________command is used to open a Database.
_________command is used to create a table in MySQL.
_________command is used to list the available Databases in MySQL.
_________command is used to remove a database from MySQL.
_________command is used to remove a table from MySQL.
_________ command is used to display the details in a Table.
_________command is used to display the structure of a Table.
SECTION – B ( ANSWER THE FOLLOWING )
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
What is MySQL?
What do you mean by DDL?
What do you mean by DML?
List out the commands of DDL.
List out the commands in DML.
Write the Syntax for Creating a Database with example.
List out the Numeric Data Types in MySql.
List out the character Data Types in MySql.
How will you see the structure of a Table? Give Example.
Write the Syntax of INSERT Command.
Write the Command to view all the contents of a Table.
Write the Command to view some of the columns of a Table.
Write the command to view the contents of a Table based on some conditions.
Give Example for using MAX & MIN Functions.
Give Example for using SUM & AVERAGE Functions.
Give Example for using COUNT Functions.
DELETE
ALTER
FLOAT
DESC
WHERE
SELECT
SHOW
SECTION – C ( MATCH THE FOLLOWING )
- (a) To Check Condition in Displaying Table.
- (b) To display the structure of a Table.
- (c) To list the available databases in MySQL.
- (d) To display the contents of a Table.
- (e) To remove contents of a Table.
- (f) To modify the structure of a Table.
- (g) Numeric Data Type.
SECTION – D ( MY SQL DATABASE CREATION, INSERTION OF RECORDS, DISPLAYING
INFORMATION)
34. Create a Table Stock with the following fields :
StockId
- Integer
- Size(3)
Incharge
- Varchar(30)
Item
- Varchar(15)
No_units
- Integer
- Size (3)
Price
- Integer
- Size (6)
Perform the following :
1. Create the table Stock.
2. Write commands to insert 3 records in the Stock table.
3. Write command to display all the information in the file.
4. Write command to display Item and No_units, if price is greater than 30.
5. Write command to display the maximum and minimum Price Values.
35. Create a Table Bill with the following fields :
BillId
- Integer
- Size(3)
Customer
- Varchar(30)
PItem
- Varchar(15)
Rate
- Integer
- Size (4)
No_units
- Integer
- Size (3)
NetAmt
- Integer
- Size (8)
Perform the following :
1. Create the table Bill.
2. Write commands to insert 3 records in the Bill table.
3. Write command to display all the information in the file.
4. Write command to display Cashier, Item and Net, if NetAmt is greater than 500.
5. Write command to display the Sum and Average NetAmt Values.
36. Create a Table Cricket with the following fields :
PNo
- Integer
- Size(3)
PName
- Varchar(30)
No_Matches - Varchar(15)
No_Runs
- Integer
- Size (3)
No_Wickets
- Integer
- Size (6)
Perform the following :
1. Create the table Cricket.
2. Write commands to insert 3 records in the Stock table.
3. Write command to display all the information in the file.
4. Write command to display PName, No_Runs from Cricket Table, if No_Matches is greater
than 100.
5. Write command to display the count of players where No_Wickets > 50.
INDIAN SCHOOL AL WADI AL KABIR
DEPARTMENT OF COMPUTER SCIENCE
REVISION QUESTION BANK ANSWERS – CLASS X – MY SQL
SECTION – A ( FILL IN THE BLANKS )
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Data Definition Language.
Data Manipulation Language.
mysql.
USE DATABASE.
CREATE TABLE.
SHOW DATABASES.
DROP DATABASES.
DROP TABLE.
SELECT.
DESC TABLE_NAME.
SECTION – B ( ANSWER THE FOLLOWING )
11. My SQL is one of the popular Relational Database Management Systems.
12. Data Definition Language – These are used to create and modify the structure of your tables
and other objects in the database.
13. Data Manipulation Language - These are used to work with the data in tables of an existing
database.
14. CREATE DATABASE, ALTER DATABASE, CREATE TABLE, ALTER TABLE, DROP TABLE, DROP
DATABASE.
15. INSERT, DELETE, SELECT, UPDATE.
16. CREATE DATABASE Database Name; Example : CREATE DATABASE STUDENT;
17. INT(Length), FLOAT(Length), DOUBLE(Length).
18. CHAR(Length), VARCHAR(Length).
19. A Table structure can be viewed by using: DESC Table Name; Example : DESC Stud;
20. INSERT INTO TABLE_NAME VALUES(Value1, Value2, ……….., Value N);
21. SELECT * FROM TABLE_NAME;
Example : SELECT * FROM EMPLOYEE;
22. SELECT Column1, Column2, ……….., Column N FROM TBALE_NAME;
Example : SELECT EMPNAME, DEPARTMENT, SALARY FROM EMPLOYEE;
23. SELECT * FROM TABLE_NAME WHERE CONDITION;
EXAMPLE 1 : SELECT * FROM STUDENT WHERE MARK > 90;
EXAMPLE 2 :SELECT EMPNAME, DEPARTMENT, AGE FROM EMPLOYEE WHERE SALARY < 8000;
24. SELECT MAX (MARK) FROM STUDENT;
SELECT MIN (BONUS) FROM EMPLOYEE;
SELECT SUM(SCORE) FROM GAMES;
SELECT AVERAGE(MARK) FROM CLASS;
25. SELECT COUNT(STUDNAME) FROM STUDENT WHERE MARK > 75;
SECTION – C ( MATCH THE FOLLOWING )
26.
27.
28.
29.
30.
31.
32.
DELETE
- (e) To remove contents of a Table.
ALTER
- (g) To modify the structure of a Table.
FLOAT
- (f) Numeric Data Type.
DESC
- (b) To display the structure of a Table.
WHERE
- (a) To Check Condition in Displaying Records in a Table.
SELECT
- (d) To display the contents of a Table.
SHOW
- (c) To list the available databases in MySQL.
SECTION – D ( MY SQL DATABASE CREATION, INSERTION OF RECORDS, DISPLAYING
INFORMATION)
33. STOCK TABLE :
1. CREATE TABLE STOCK(STOCKID INTEGER(3), INCHARGE VARCHAR(30), ITEM VARCHAR(15),
NO_UNITS INTEGER(3), PRICE INTEGER(6));
2. INSERT INTO STOCK VALUES(101,’RAKESH’,’TSHIRT’,600,900);
INSERT INTO STOCK VALUES(102,’MADHU’,’CASUAL SHIRT’,125,1200);
INSERT INTO STOCK VALUES(103,’SUJA’,’CHUDITHAR’,275,600);
3. SELECT * FROM STOCK;
4. SELECT ITEM, NO_UNITS FROM STOCK WHERE PRICE > 30;
5. SELECT MAX(PRICE), MIN(PRICE) FROM STOCK;
34. BILL TABLE:
1. CREATE TABLE BILL(BILLID INT(3), CUSTOMER VARCHAR(30), PITEM VARCHAR(15), RATE
INT(4), NO_UNITS INTEGER(3), NETAMT INTEGER(8));
2. INSERT INTO BILL VALUES(2411,’AMALA’,’SUGAR’,32,5,160);
INSERT INTO BILL VALUES(2412,’NITIN’,’RICE’,40,10,400);
INSERT INTO BILL VALUES(2413,’POOJA’,’COFFEE’,190,2,380);
3. SELECT * FROM BILL;
4. SELECT CUSTOMER, ITEM, NETAMT FROM BILL WHERE NETAMT > 300;
5. SELECT SUM(NETAMT), AVG(NETAMT) FROM BILL;
35. CRICKET TABLE :
1. CREATE TABLE CRICKET(PNO INTEGER(2), PNAME VARCHAR(30), NO_MATCHES
VARCHAR(15), NO_RUNS INTEGER(5), NO_WICKETS INTEGER(3));
2. INSERT INTO CRICKET VALUES(1,’SHEWAG’,275,9800,165);
INSERT INTO CRICKET VALUES(2,’SACHIN’,410,16285,189);
INSERT INTO CRICKET VALUES(3,’KAPIL DEV’,263,6789,313);
3. SELECT * FROM CRICKET;
4. SELECT PNAME, NO_RUNS FROM CRICKET WHERE NO_MATCHES > 100;
5. SELECT COUNT(PNAME) FROM CRICKET WHERE NO_WICKETS > 50;
COMPUTER SCIENCE THEORY EXAM(FINAL) PATTERN
SECTION
A
B
C
D
No.of Questions
6
10
4
2
Mark
½
1
½
5
Total
3
10
2
10