数据库代写|COMS W4111: Introduction to Databases Spring 2023, Sections 002

这是一篇来自美国的关于熟悉代码核心概念、ER 建模、关系代数、SQL并解决一些相关问题的数据库代写

 

Homework 1, Part 1

Introduction to Core Concepts, ER Modeling, Relational Algebra, SQL

Introduction and Overview

HW Objectives

●HW 1 will have two parts. This is the first part.
●Part 1 tests and reinforces the basic elements of:
Database concepts.
Relational model and relational algebra.
■Data modeling.
■SQL.
●Part 2 will have a set of practical exercises that have students implement simple but realistic tasks.
●Part 1 applies to both programming and non-programming tracks. .

Submission Instructions

Complete all the tests in this notebook and submit only this notebook as a PDF to GradeScope. To convert the jupyter notebook into a pdf you can use either of the followving methods:

●File –> Print Preview –> Print -> Save to PDF
●File –> Download As HTML –> Print -> Save to PDF

Due date: February 12, 11:59 PM EDT on GradeScope

It is recommended that you put the screenshots into the same folder as this notebook so you do not have to alter the path to include your images.

Please read all the instructions thoroughly!

Guidelines

You may not work with or collaborate with anyone in any way to complete the homework. You may speak with the professor and TAs. You may ask private questions on Ed if you need clarification.

You may use lecture slides, the textbook slides, the textbook or public information on the web to help you answer your questions. You may not “cut and past” information. Your answer must be in your own words and demonstrate the you understand the concept. If you use information for sources other than lectures,lecture slides, textbook slides or the textbook, you MUST provide a URL to the source you used.

Read the Columbia University academic integrity. information. (ttps://www.cc seas.columbia.edu/inegrity.). In the answer section, state that you take the pledge.

Answer:

Add Student Information
1. Replace my name with your full name.
2. Replace my UNI with your UNI.
3. Replace “Cool Track” with either “Programming” or “Non-programming.”

S1: This is a sample of the format for answering the relational algebra questions. Your answer will contain:
1. A markdown cell with the relational algebra statement.
2. A screen capture of the execution.

You will use the RelaX calculator (tts:/bis-uibk.github.io/relax/calc/gist/47866c17624ca9dfa85ed2482078be8/relax- siberschatz english.txt/0). with the schema associated with the book.

Write a relational algebra statement that produces a relation with the columns:
●section.course_ id
●section.sec_ id
●section.semester
●section.year
●section.building
●section.room_ number
●classroom.capacity

And only contains tuples from the Spring semester and a classroom. capacity > 50.

Answer:

Algebra statement.
o semester=’ Spring’人capacity>50
(π course_ id, sec_ id, semester, year, building, room_ number, capacity
(section冈classroom)
)

Screen capture:

R2: Write a relational algebra expression that returns a relation of the form:

●section.course_ id
●section.sec_ id
●section.semester
●section.year
●teaches.ID
●instructor.name
●course .credits

The relation contains courses that earn at least 4 credits.

Answer:

Relational algebra:

Screen capture: