0% found this document useful (0 votes)
25 views6 pages

Lab Assignment ITEC 211 G 563

Lab Assignment

Uploaded by

saheralshadady
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views6 pages

Lab Assignment ITEC 211 G 563

Lab Assignment

Uploaded by

saheralshadady
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

KINGDOM OF SAUDI ARABIA

MINISTRY OF EDUCATION – JAZAN UNIVERSITY


COLLEGE OF ENGINEERING & COMPUTER
SCIENCE

LAB ASSIGNMENT
Term:( First / □Second) Academic Year: 2024- 2025
Student Name: Elaf Student ID: 20416241
Section Number: Serial Number: Start Date: 19/10/2024
Course Name: Database Concepts & Design End Date: 10/10/2024
Course Code: ITEC-211 Format: .doc, .docx, .pdf
Course Level: 4 Maximum Marks: 10 Duration: 3 weeks

Marks Summary
Questions # Q.1 Q.2 Q.3 Q.4 Q5

CLO#
Aligned Performance
Indicator (PI)
Aligned Student
Outcome (SO)
Marks Allocated 2 3 2 1 2
Marks
Obtained
Student Outcomes (SOs) – Marks Summary
Student
SO1 SO2 SO3 SO4 SO5 SO6
Outcomes
Marks
Allocated
Marks
Obtained

Total Marks Faculty NAZIYA Faculty


Obtained Name Signature

INSTRUCTIONS FOR STUDENTS

Include a title page with assignment number, Jazan University logo, student name, student Jazan University ID,
teacher name, course name, course code, program name, department and college name.
Use the required naming convention, typically including your name, course code.
Use font Times New Roman, and font size 14 for title page text and make it bold.
Use font Times New Roman, and font size 12 for rest of the pages. Make headings bold.
Use 1.5 spacing with 1-inch margins on all sides.
Attach the OUTPUT below the steps/program.
Include page numbers on each page except the title page.
Mention answers number in each page.
Correct all common spelling, and typographical errors (use spell-check).
Submit the Assignment (in this format)to correct section number on Blackboard in .doc, .docx, or .pdf format.

NOTE: STUDENTS MUST USE THEIR NAME TO EXCUTE THE PROGRAM.

ITEC-211/database concepts & design/2024-2025/First Semester Page 1 of 2


ANSWER THE FOLLOWING
QUESTIONS.

Q.1: Create table with your name(Student Name) with following attributes & ADD
Primary key to S_id.

Note: When you create table EDIT attribute according to your table name.

S_id S_name S_age S_marks S_phone_no

Q1b. Write a sql query to view the structure of

the table. Q1c. Insert the FIVE values for the

above table.

Q2a.Write a sql query to alter the name of the column (S_phone_no to

S_Contact_no) Q2b. Write a sql query to alter the table to ADD new

column in above table.

Q2c.Write a sql query to alter MODIFIES any column in the above table.

Q3a.Write a sql query to display anyone column from the above table by using
SELECT command.

Q3b. Write a sql query to display anyone ROW from the above table by using
SELECT command.

Q4. Write a sql query to UPDATE any value in the Table.

Q5a. Perform SQL arithmetic Operators(+,-,*,/) on the

values 20 , 5. Q5b. By using alter command drop any

column from the above table.


Answer q:1

SQL

CREATE TABLE Student_Info (


S_id INT PRIMARY KEY,
S_name VARCHAR(50),
S_age INT,
S_marks INT,
S_phone_no VARCHAR(20)
);

INSERT INTO Student_Info (S_id, S_name, S_age, S_marks, S_phone_no)


VALUES
(1, 'Elaf', 21, 25, '0501691327'),
(2, 'Ali', 22, 30, '0502345678'),
(3, 'Sara', 20, 28, '0509876543'),
(4, 'Omar', 23, 32, '0501234567'),
(5, 'Fatima', 21, 27, '0508765432');

Output
SELECT * FROM Student_Info;

S_id S_name S_age S_marks S_phone_no

1 Elaf 21 25 0501691327

2 Ali 22 30 0502345678

3 Sara 20 28 0509876543

4 Omar 23 32 0501234567

5 Fatima 21 27 0508765432

Q2b. Add a new column:

SQL
ALTER TABLE Student_Info
ADD COLUMN S_email VARCHAR(50);

Output: A new column named S_email of type VARCHAR(50) is added to the Student_Info table.

Q2c. Modify a column:

SQL

ALTER TABLE Student_Info


MODIFY COLUMN S_marks DECIMAL(5,2);

Output: The S_marks column is modified to store decimal values with 5 digits and 2 decimal places.

Q3a. Display a column:

SQL

SELECT S_name FROM Student_Info;

Output:

S_name
------
Elaf
Ali
Sara
Omar
Fatima

Q3b. Display a row:

SQL

SELECT * FROM Student_Info WHERE S_id = 1;

Output:
S_id | S_name | S_age | S_marks | S_phone_no | S_email
-----+--------+-------+---------+-----------+--------
1 | Elaf | 21 | 25 | 0501691327 | NULL

Q4. Update a value:

SQL

UPDATE Student_Info
SET S_marks = 30
WHERE S_id = 2;

Output: The S_marks value for the student with S_id 2 is updated to 30.

Q5a. Perform arithmetic operations:

SQL

SELECT 20 + 5 AS Addition,
20 - 5 AS Subtraction,
20 * 5 AS Multiplication,
20 / 5 AS Division;

Output:

Addition | Subtraction | Multiplication | Division


---------+-------------+---------------+---------
25 | 15 | 100 | 4

Q5b. Drop a column:

SQL

ALTER TABLE Student_Info


DROP COLUMN S_email;

Output: The S_email column is removed from the Student_Info table.


Note:
1.Copying of work (texts, lab results etc.) from other students/groups or
from other sources is not allowed.
2. Assignments must be submitted on the due dates. Some
points will be deducted for late submissions.
3. Submit the assignment solution on the Blackboard
in pdf or doc format only. 4..Please don’t upload your
assignment as image.
5. Attach the OUTPUT below the steps/program

ITEC-211/database concepts & design /2024-2025/First Semester Page 2 of 2

You might also like