Course: Fundamentals of Databases
Write a Query for the Following Table.
Table Name: Student
Stu_ID |
Name |
Age |
Address |
Phone |
1452364 |
Alla |
22 |
Riyadh |
7772223310 |
1452365 |
Ahamed |
25 |
Jeddah |
7772223311 |
a) Write a Query for Create Table:
b) Write a Query for insert filed in above Given Table.
c) Write a Query for Replace Age = 25 Replace by 26 the above given Table.
d) Write a Query for Remove Student ID =1452364 one Row above given Table.
e) Drop Student Table.
f) Arrange name filed at assisting order.
a) CREATE TABLE Student(Stu_ID integer,Name text,Age integer,Address text,Phone integer);
b) INSERT INTO Student VALUES
(1452364,'Alla',22,'Riyadh',7772223310);
INSERT INTO Student VALUES
(1452365,'Ahamed',25,'Jeddah',7772223311);
Select * from Student;
Output:
c) SELECT REPLACE(Age, 25,26) from Student;
Output:
d) Write a Query for Remove Student ID =1452364 one Row above given Table.
DELETE FROM Student WHERE Stu_ID = 1452364;
Select * from Student;
Output:
e) DROP TABLE Student;
Course: Fundamentals of Databases Write a Query for the Following Table. Table Name: Student Stu_ID Name...
Write a query in SQL to list the following information of the artists in movie industry. Limit this information to only 5 artists. Sort the information by age descending order. Full name : first name and last name separated by space Age: Current age Address: State that he resides Contact number: Phone number This is from an artist table, where first_name, last_name, contact_no, address, birth_date are the fields in the table. Birth date in the table...
gender) in HDFS, write a MapReduce Given a 10TB table Student (name, year, program to compute the following query. gpa, SELECTyear, AVG (gpa) FROM WHERE GROUP BY year Student gender'Male' Answer gender) in HDFS, write a MapReduce Given a 10TB table Student (name, year, program to compute the following query. gpa, SELECTyear, AVG (gpa) FROM WHERE GROUP BY year Student gender'Male' Answer
Student(Student number, student name, semester) Course(Course number, course name, credits, transfer credits) PART A: Using above BS in MIS degree requirements, perform the following (25 points) Develop tables (provide create statements) Normalize them (make sure they are in 3rd NF) Draw a single ERD – clearly identify Primary and Foreign keys (state any assumptions made) (10 points) Create following views: (5 points) Create a view that would list all MIS required courses Create a view that will give a total...
Given the bsg_planets table created by using the following definition query : -- CREATE TABLE `bsg_planets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `population` bigint(20) DEFAULT NULL, `language` varchar(255) DEFAULT NULL, `capital` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Insert information about the planet Mars which has a population of 2, language as "Binary" and "Olympus Mons" as Capital, in bsg_planets. Then list the row(s), with all the information for that...
1. Answer the questions with respect to the table below. users gender id name age occ_id city_id John 25 M 3 1 2. Sara 20 F 3 4 3 Victor 31 M 2 LO 4 Jane 27 F 1 3 occupation id name 1 2 Software Engineer Accountant Pharmacist Library Assistant 3 City id name 1 2 Halifax Calgary Boston 3 4 New York 5 Toronto (b) [2.5+2.5+5) Write query to make a copy of 'users' table known as 'users_new'....
1. Given the table above, write an SQL Query that will select only those individuals that scored 800 or higher, sorted by last name in ascending order. 2. Given the table above, write an SQL Query that will add a new entry for John Smith with a score of 834. The field id is auto incrementing. 3. Given the data below, write an SQL Query that will delete any values where the score is below 740. id Fname Lname Score...
Please help me on the SQL queries, thank you so much. Write a query to display the title and publisher as well as the publisher contact for each book using JOIN...USING clause. Write a query to show the first and last names of customers who have ordered cooking books. Use the WHERE clause to join the tables. Write a query to show the title, cost and ISBN of each book in the books table. If the book has been ordered,...
Problems and Exercises 1 through 9 are based on the dass scheduling 3NF relations along with some sample data shown in Figure 6-11. Not shown in this figure are data for an ASSIGNMENT relation, which represents a many-to-many relationship between faculty and sections.4. Write SQL data definition commands for each of the following queries:a. How would you add an attribute, Class, to the Student table?b. How would you remove the Registration table?c. How would you change the FacultyName field from...
(PL/SQL Programming) Consider the table EMPLOYEE with attributes ID, Name, and Hours, and the table PAYINFO with attributes Regular, Overtime, and HourLimit, defined and populated by the following script: DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE EMPLOYEE ( ID CHAR(5), Name VARCHAR2(16), Hours NUMBER(2), CONSTRAINT PK_EMPLOYEE PRIMARY KEY (ID) ); INSERT INTO EMPLOYEE VALUES ('22144', 'Anderson', 30); INSERT INTO EMPLOYEE VALUES ('31902', 'Bruford', 45); INSERT INTO EMPLOYEE VALUES ('42771', 'Wakeman', 20); INSERT INTO EMPLOYEE VALUES...
what sql statements does the following from a table like this? ex 2.4 course Id Name semester semester Grade 2.4 OL Jenent at creates the TRANSCRIPT table. Using the TRANSCRIPT table, write an SQL statement that a. Deregisters the student with Id - 123456789 from the course CS305 for the fall of 2001 b. Changes to an A the grade assigned to the student with Id - 123456789 for the course CS305 taken in the fall of 2000 C. Returns...