4. Practical File
4. Practical File
Properties)
Create a database in MS-Access of Student Information
Create table STUDENT, the fields are as follows:
SID, Name, Class, Address, CNIC, City, Email, DOB and set the following properties
1. Set SID as primary Key and set caption property for ‘SID as ‘Student Identity’.
2. Set field size of name up to 50 characters and set it as ‘not null’.
3. Produce a list of available values using look up wizard in the field class.
4. Give CNIC short text data type and apply input mask as 00000-0000000-0
5. Give default value in the city as ‘Karachi’.
6. Apply no duplication on Email.
7. Apply ‘medium date’ format to DOB.
8. Enter 5 Records in the table.
Give CNIC short text data type and apply input mask as 00000-0000000-0
Create table books (Book_Id, Title, Publisher Name, Author Name, issued) with suitable
data types.
Display a list of books where Authors’ name starts with ‘M’ and issued is ‘Yes’.
Create table Citizens (CNIC, Name, DOB, Address, Phone, Email) taking suitable data
types using CREATE statement. Set CNIC as Primary Key and Name as Not Null.
Insert 4 records in the table using insert statement.
Change the structure of the table using ALTER statement and add field of city and
country.
Open the table in data sheet view and enter cities and countries.
Remove the field of country using DROP statement.
Enter two more records in the table using datasheet view.
Write SQL statement to delete the table.
Open the table in data sheet view and enter cities and countries.
1. Create table Patient (Patient_Id, Patient Name, Gender, DOB, Diagnosis, Prescription,
Doctor Name, DOT) with appropriate data types and suitable primary key & enter 10
records.
2. Create queries in design view the following names and purposes:
TB Patients: Displays the records of male patients who have TB diagnosed.
Started by M: Display the name and gender of male patients whose names are started
by ‘M’.
Fever Patients: Display the records of patients who are having Dengue, Malaria or
Typhoid.
2016 to 2018 Patients: Display the records of patients who were treated during
1/01/2016 to 1/01/2018.
55 Years Old Females: Display the record of females who are older than 55 years on
12/12/2018.
Without Prescription: Display the records of all the patients who have not prescribed any
medicine.
Other than Dr. Ahmed: Display the list of patients who are not treated by Dr. Ahmed.
Fever Patients: Display the records of patients who are having Dengue, Malaria or
Typhoid
55 Years Old Females: Display the record of females who are older than 55
years on 12/12/201
Other than Dr. Ahmed: Display the list of patients who are not treated by Dr.
Ahmed
2. Started by M: Display the name of male employees whose names are started by ‘M’.
4. 2009 to 2011 Employees: Display the records of employees who joined during 1/01/2009
to 1/01/2011.
6. Without Emails: Display the records of all the employees who have no email address.
Create table SCORE (Player_Id, Player_Name, Runs, Balls) with suitable data types and
primary key.
Run SQL query to update the runs and ball of the player whose Player_Id is 452.
Create Relationship one to many between the tables and enter five records.
Create table Marks (SID, Name, Math, Computer, Physics, English, Urdu).
Create table Expense (Family No, Conveyance, Foods, Clothing, Rent, Education)
Print report.