Update you’re the database created in week5: lab5. Write some MYSQL code to select three different sets of data and display them on the screen. Also, delete two different records from any of the table in your the database and then print the remaining data on the screen. Finally, update one of your table with five more new rows of data and print the result of the table on the screen. Detail prior database below. Create the table StudentInf: CREATE TABLE StudentInf (rollNo INT(4) PRIMARY KEY,first_Name VARCHAR(50) NOT NULL,last_Name VARCHAR(50) NOT NULL,gender VARCHAR(10),course VARCHAR(50)); Inserting data in StudentInf table: INSERT INTO StudentInf VALUES (101, 'TONY', 'ANDREW', 'Male', 'JAVA'); INSERT INTO StudentInf VALUES (102, 'JOHN', 'MARTIS', 'Male', 'PHP'); INSERT INTO StudentInf VALUES (103, 'SWEETIE', 'JOHNSON', 'Female', 'C#'); INSERT INTO StudentInf VALUES (104, 'JIM', 'WATSON', 'Male', 'PYTHON'); INSERT INTO StudentInf VALUES (105, 'BRUCE', 'DOWNEY', 'Male', 'PHP'); Create the table IntructorInf: CREATE TABLE InstructorInf (id INT(4) PRIMARY KEY,first_Name VARCHAR(50) NOT NULL,last_Name VARCHAR(50) NOT NULL,title VARCHAR(50),phone_No VARCHAR(20)); Inserting data in IntructorInf table: INSERT INTO InstructorInf VALUES (10, 'JOHN', 'MARTIS', 'PHP Expert', '263432446325');INSERT INTO InstructorInf VALUES (11, 'SWEETIE', 'JOE', 'C++ Expert', '2627127834');INSERT INTO InstructorInf VALUES (12, 'TONY', 'ANDREW', 'Java Expert', '91822233444');INSERT INTO InstructorInf VALUES (13, 'BRUCE', 'VANDY', 'PHP Expert', '32834787713');INSERT INTO InstructorInf VALUES (14, 'NEIL', 'WARNER', 'C# Experts', '747128578374'); Create the table LikedAndDisliked: CREATE TABLE LikedAndDisliked (id INT(4) PRIMARY KEY,liked INT(4),disliked INT(4),comment VARCHAR(50),rating INT(5)); Inserting data in LikedAndDisliked table: INSERT INTO LikedAndDisliked VALUES (17, 4, 6, 'Good', 10);INSERT INTO LikedAndDisliked VALUES (12, 4, 4, 'Best', 6); INSERT INTO LikedAndDisliked VALUES (13, 8, 2, 'Average', 5);INSERT INTO LikedAndDisliked VALUES (14, 3, 0, 'Worst', 4);INSERT INTO LikedAndDisliked VALUES (15, 6, 2, 'Not so good', 8);
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Update you’re the
Create the table StudentInf:
CREATE TABLE StudentInf (
rollNo INT(4) PRIMARY KEY,
first_Name VARCHAR(50) NOT NULL,
last_Name VARCHAR(50) NOT NULL,
gender VARCHAR(10),
course VARCHAR(50)
);
Inserting data in StudentInf table:
INSERT INTO StudentInf VALUES (101, 'TONY', 'ANDREW', 'Male', 'JAVA');
INSERT INTO StudentInf VALUES (102, 'JOHN', 'MARTIS', 'Male', 'PHP');
INSERT INTO StudentInf VALUES (103, 'SWEETIE', 'JOHNSON', 'Female', 'C#');
INSERT INTO StudentInf VALUES (104, 'JIM', 'WATSON', 'Male', 'PYTHON');
INSERT INTO StudentInf VALUES (105, 'BRUCE', 'DOWNEY', 'Male', 'PHP');
Create the table IntructorInf:
CREATE TABLE InstructorInf (
id INT(4) PRIMARY KEY,
first_Name VARCHAR(50) NOT NULL,
last_Name VARCHAR(50) NOT NULL,
title VARCHAR(50),
phone_No VARCHAR(20)
);
Inserting data in IntructorInf table:
INSERT INTO InstructorInf VALUES (10, 'JOHN', 'MARTIS', 'PHP Expert', '263432446325');
INSERT INTO InstructorInf VALUES (11, 'SWEETIE', 'JOE', 'C++ Expert', '2627127834');
INSERT INTO InstructorInf VALUES (12, 'TONY', 'ANDREW', 'Java Expert', '91822233444');
INSERT INTO InstructorInf VALUES (13, 'BRUCE', 'VANDY', 'PHP Expert', '32834787713');
INSERT INTO InstructorInf VALUES (14, 'NEIL', 'WARNER', 'C# Experts', '747128578374');
Create the table LikedAndDisliked:
CREATE TABLE LikedAndDisliked (
id INT(4) PRIMARY KEY,
liked INT(4),
disliked INT(4),
comment VARCHAR(50),
rating INT(5)
);
Inserting data in LikedAndDisliked table:
INSERT INTO LikedAndDisliked VALUES (17, 4, 6, 'Good', 10);
INSERT INTO LikedAndDisliked VALUES (12, 4, 4, 'Best', 6);
INSERT INTO LikedAndDisliked VALUES (13, 8, 2, 'Average', 5);
INSERT INTO LikedAndDisliked VALUES (14, 3, 0, 'Worst', 4);
INSERT INTO LikedAndDisliked VALUES (15, 6, 2, 'Not so good', 8);
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images