0% found this document useful (0 votes)
32 views

CST282-1 Assignment SQL

1. The document describes a MySQL database management systems lab assignment to get familiar with basic MySQL commands and queries. 2. Students are instructed to execute simple queries like SHOW DATABASES and SELECT statements to view the database version, current date, and user information. 3. The assignment also involves modifying the output header names of queries, performing mathematical operations in MySQL, creating a database and table with sample data, and retrieving records from the table.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

CST282-1 Assignment SQL

1. The document describes a MySQL database management systems lab assignment to get familiar with basic MySQL commands and queries. 2. Students are instructed to execute simple queries like SHOW DATABASES and SELECT statements to view the database version, current date, and user information. 3. The assignment also involves modifying the output header names of queries, performing mathematical operations in MySQL, creating a database and table with sample data, and retrieving records from the table.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CST283-1 Database Management Systems Laboratory Assignment 01 MySQL Basics

Complete the following assignment during your lab class and upload the result file as instructed below. MySQL prompt will flush the output into a text file by issuing the command tee. For example, by issuing the command: mysql> tee cst06xxx.txt MySQL starts logging console text into a file named cst06xxx.txt at your home folder. To Stop sending output into a file, use the command notee

1. Execute the following simple queries and observe the output. 1. 2. 3. 4.


SHOW DATABASES; SELECT VERSION(), CURRENT_DATE; SELECT SIN(PI()/4), (4+1)*5;

SELECT USER(), NOW();

5. SELECT VERSION(); SELECT CURRENT_DATE; SELECT CURRENT_TIME; 2. Modify your queries to give custom output header names as follow, 1. VERSION()--> MYSQL_VERSION 2. CURRENT_DATE --> TODAY 3. USER --> ME 4. NOW --> TIMESTAMP 5. CURRENT_TIME --> TIME 3. Perform the following mathematical operations using MySQL (Hint 1. Find 2. Find 3. Find 4. Evaluate 4. Create database using your User Name (ex: CST06043) 1. Create a table named Student with following columns i. StudentID: Varchar(16) ii. FirstName:Varchar(32) iii. LastName:Varchar(48) iv. NIC:Char(10) and )

v. Address:Varchar(128) vi. DateOfBirth: Date 2. Populate 10 records using INSERT INTO statement to the above created table. 3. Retrieve the StudentID, FirstName and LastName of the entered records using SELECT statement.

You might also like