Question

5. Consider database system with two tables at different two sites as follow: Site 1 Student Table Student-ID Student -NAME A
0 0
Add a comment Improve this question Transcribed image text
Answer #1

First create the table student syntax is

create table tablename(attribute1,datatype1

attribute2,datatype2.........

attributen,datatypen);

Create table student(Student-ID varchar(10),Student-NAME varchar(20),Address varchar(20));

Table is created ,now insert values into the student table

As an example i will show

Insert syntax:

insert into table tablename values(value1,value2,value3....valuen);

insert into table student values('501','harsha','hyd');

insert into table student values('502','jaanu','mbnr');

Insert 200records in this way!

Now create table course

Create table course(Course-ID varchar(20),Course-NAME varchar(30),Student-ID varchar(10));

Course table is created now insert required number of values into the table

insert into table course values('101','CSE','501');

In this way we have to insert 40records and in student table 200records

Now solution for query:

Select Student-NAME,Course-NAME

from student ,course

Where student.Student-ID=course .Student-ID;

We will get the result.

Alternative query is

Select Student-NAME,Course-NAME from student s ,course c where s.Student-ID=c.Student-ID;

By renaming operation we can minimise the query

Cost of stratergy: both gives the result appropriate..in order to have less number of lines we can use rename operation and follow that query..

@ I find the nanna Relational Algebra: T Student-NAME, course -NAME(Studentu course

Writing queries in realtion algebra are some what tough ,you need to understand everything and then it will be easy

Add a comment
Know the answer?
Add Answer to:
5. Consider database system with two tables at different two sites as follow: Site 1 Student...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • w with explanation please Pg. 02 Question Two Leaming Outcomers) Question Two 10 Marks Create a...

    w with explanation please Pg. 02 Question Two Leaming Outcomers) Question Two 10 Marks Create a SQL statement to retrieve information from a relational database Consider the relations: requested STUDENT | Student# Std-Name Address Khan Madina Muhammad Yanbu 3 Ahmad Riyadh |+| COURSE Student# Course | Course-Name 1 IT342Enterprise Systems 2 IT407Professional Issues 2 IT445DSS Write a query using the Right Outer Join to retrieve the record from the two relations. Also, construct the table displaying the output of your...

  • Consider the Schema diagram for a university database a. Find the IDs of all students who...

    Consider the Schema diagram for a university database a. Find the IDs of all students who have taken all of the CMPSC courses. Use the division operation. b. Do the same operation as in problem a, using only fundamental operations. student takes ID course id sec id semester 1er 4112 dept_name tot cred grade advisor section course_id sec id semester year building TOOM_10 time_slof_id course course id title dept name credits department dept name building budget time slot time slot...

  • 1. Consider the following database. Note that it distinguishes between a course and the class of...

    1. Consider the following database. Note that it distinguishes between a course and the class of that course in a particular year. Courses can have prerequisites (aka a prereq), which is again a course. Person(UPI, givenname, surname) with key UPI Courses(course, title, program) with key course Classes(classnr, course, year) with key classnr Enrollments(UPI, classnr) Grades(UPI, classnr, grade) Prereqs(course, prereq) Teachers(UPI, classnr) With natural foreign key constraints given by common attribute names. 1. List all UPIs of all teachers who teach...

  • Consider a database schema consisting of two tables, Employee (ID, Name, Address), Project(PID, Name, Deadline), Assign...

    Consider a database schema consisting of two tables, Employee (ID, Name, Address), Project(PID, Name, Deadline), Assign (EID, PID, Date). Assign.EID is a foreign key referencing employee's ID and Assign.PID is a foreign key reference the project. Write the SQL query for 1. Find Projects that are not assigned to any employees(PID and Name of the project).

  • This is database system concept. 1.Find the ids of instructors who are also students using a...

    This is database system concept. 1.Find the ids of instructors who are also students using a set operation. Assume that a person is identified by her or his id. So, if the same id appears in both instructor and student, then that person is both an instructor and a student. Remember: set operation means union, intersect or set difference. 2.Find the ids of instructors who are also students using the set membership operator. 3.Find the ids of instructors who are...

  • 3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra...

    3. (20 POINTS) Consider the LIBRARY relational database schema below to write down the relational algebra expressions for the following two queries. No SQL statements are required. BOOK Bookid Title Publisher name BOOK AUTHORS Book id Author name PUBLISHER Name Address Phone BOOK COPIES Book d Branch Id No o copies BOOK LOANS Book Branch Id Card no Date out Due date LIBRARY BRANCH Branch Branch name Address BORROWER Card Name Address Phone 3.A.) (10 POINTS) Let the number of...

  • Task 4 Consider the tables given below and write the relational Algebra for the following tasks:...

    Task 4 Consider the tables given below and write the relational Algebra for the following tasks: (30 Marks) Table Name: Products ProductID Product Name 1 Unit Price Supplier 10 boxes x 20 bags 181 24 - 12 oz bottles 191 12-550 ml bottles 10 1 2 Chang Aniseed Syrup MEC AMO_TEM OM ON Fundamentals of Relational Database Management Systems (COMP 20002) - Spring-2020 -CW Assignment - ALL-OP 4 ChefAnton's Cajun Seasoning 48-6 oz jars 22 2 Table Name: Suppliers Supplier...

  • Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course.

    Question: Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course. 1- Draw an ER diagram of ONLINE COURSE REGISRATION database, that captures all the given below requirements. Specify key attribute(s) of each entity set. For each relationship set, specify structural constraints and participation constraints. a. For each USER, the portal maintains user ID, Name, E-mail. Each user has a unique ID. Name is a Composite attributes with Frame, Midname,...

  • Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department)...

    Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department) ENROLL(S-ID, C-ID, Grade) TEXTBOOK(B-ISBN, B-Title, Publisher, Author) BOOK-ADOPTION(C-ID, B-ISBN) (a) Draw the database relational schema and show the primary keys and referential integrity constraints on the schema. (b) How many superkeys does the relation TEXTBOOK have? List ALL of them. (c) Now assume each COURSE has distinct C-Name. (i) If C-ID is a primary key, what are the candidate keys and the unique keys...

  • Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orde...

    Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT