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

mysql_assign_2

The document outlines the creation of two SQL tables: 'Customer' and 'employees', including their respective fields and data types. It provides instructions for inserting 10 records into each table and specifies various SQL queries to fetch specific data from these tables based on certain conditions. The queries include fetching names, sorting records, and filtering based on age and salary criteria.

Uploaded by

Akansha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

mysql_assign_2

The document outlines the creation of two SQL tables: 'Customer' and 'employees', including their respective fields and data types. It provides instructions for inserting 10 records into each table and specifies various SQL queries to fetch specific data from these tables based on certain conditions. The queries include fetching names, sorting records, and filtering based on age and salary criteria.

Uploaded by

Akansha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Assignment 2

1) Create a table customer with configuration

CREATE TABLE Customer(


CustomerID INT PRIMARY KEY,
CustomerName VARCHAR(50),
LastName VARCHAR(50),
Country VARCHAR(50),
Age int(2),
Phone int(10)
);

Insert 10 records same like mentioned below :-

a) Fetch CustomerName, LastName from the table Customer.


b) Fetch All records in descending order .
c) Select Customer name where age == 18.
d) Select customer name ,country , and phone where age > 19.
2) Create table employees
CREATE TABLE employees
( employee_number int primary key,
first_name char(50) NOT NULL,
last_name char(50) NOT NULL,
salary int,
dept_name varchar(50)
);

Insert 10 records same like mentioned below :-

a) Fetch records where salary is greater than 50000.


b) Fetch first_name , salary where dept_name = “Admin”.
c) Fetch records where column name should be appear like first_name as name , salary as
amount and dept_name as section.

You might also like