DATABASE Assignment
DATABASE Assignment
USE [universal]
s_tell_phone INT,
autho_id INT,
category VARCHAR(50),
edition VARCHAR(50),
price FLOAT,
publisher_id INT
)
-- Create publisher table
years_of_publisher INT
s_id INT,
staff_id INT,
s_id INT,
ISBN BIGINT,
issue_date DATE,
return_date DATE,
ISBN BIGINT,
publisher_id INT,
staff_id INT,
ISBN BIGINT,
VALUES
UPDATE [student]
SET fname = 'Kidist'
WHERE s_id = 10
VALUES
(1, 'Wondosen'),
(2, 'Abbibo')
INSERT INTO [books] (ISBN, autho_id, title, category, edition, price, publisher_id)
VALUES
VALUES
VALUES (1, 2)
π(*)(student)
σ(id=10)(student)
A. Relational algebra expression for retrieving students' Fname, Email, and Id:
4. SQL code to retrieve students' Fname, Email, and Id with an Id value of 10 and student
name is "kidst":
SELECT Fname, Email, Id FROM student WHERE Id = 10 AND Fname = 'kidst'
A. Relational algebra expression for retrieving students' Fname, Email, and Id with an Id value of 10 and
student name is "kidst":
A. Relational algebra expression for retrieving S_ID, Fname, Email, and PhoneNo of a student:
6. SQL code to fetch S_ID, Fname, ISBN, Title, Publisher, IssueDate, and ReturnDate:
SELECT S_ID, Fname, ISBN, Title, Publisher, IssueDate, ReturnDate FROM student JOIN books ON
student.S_ID = books.S_ID
A. Relational algebra expression for fetching S_ID, Fname, ISBN, Title, Publisher, IssueDate, and
ReturnDate:
SELECT S_ID, Fname, ISBN, Title, Publisher, IssueDate, ReturnDate FROM student JOIN books ON
student.S_ID = books.S_ID
C. SQL code to alter the created view by including book price in the display list:
SELECT S_ID, Fname, ISBN, Title, Publisher, IssueDate, ReturnDate, Price FROM student JOIN books ON
student.S_ID = books.S_ID
10. SQL code to backup the created database on your local machine:
The process of backing up a database may vary depending on the specific DBMS being used. Here's an
example for MySQL:
GROUP BY table_schema
GROUP MEMBERS ID