Questions tagged [relational]
526 questions
-1
votes
1 answer
SQL: How to have multiple product_id in a single sales_id without separating products using delimiters?
In the requirements given to me, multiple products can be assigned to a single sale. However, I need help how this can be done in SQL and how would the table look like. Below is what my schema looks like:
Sample Schema
In the sales fact, I also…
-1
votes
1 answer
Problems identifying mutivalued dependencies
please help me to understand the answer to this exercise about multivalued dependencies in Relational Database Design, ok,the problem is as follows:
Consider the relation StudentInfo(sID, dorm, courseNum). Students
typically live in several dorms…

byron perez
- 65
- 8
-1
votes
1 answer
Difference between natural join and simple join on common attribute in algebra
I have a confusion.
Suppose there two relation with common attribite A.
Now is
(R natural join S)=(R join S where join condition A=A)?
Natural join returns a common column A
Do simple join return two columns with same name AA or 1 common column A…

simranjit singh
- 19
- 4
-1
votes
2 answers
yocto and relational database why not?
I've been working with yocto for a while. The job involves adding a layer on top of meta-yogurt, and thus adding new or modifying existing recipes in this layer. It has been working out so far.
But through struggling with recipes/rules syntax and…

brownmonkey
- 37
- 6
-1
votes
1 answer
Reasonable Export of Relational to Non-Relational Data
We have different products that rely on relational databases for various reasons, basically the transactional nature of the operations (atomicity, consistency, etc.). This is not going to change any time soon.
Given this scenario, are there any…

fificito
- 69
- 1
- 7
-1
votes
5 answers
The Relational Model & Queries That Naturally Return Duplicate Rows
It's commonly understood that in the relational model:
Every relational operation should yield a relation.
Relations, being sets, cannot contain duplicate rows.
Imagine a 'USERS' relation that contains the following data.
ID FIRST_NAME LAST_NAME
…

Seun Osewa
- 4,965
- 3
- 29
- 32
-1
votes
1 answer
Two entities should have same parent entity in relational model
I have simple models: People, Photos, Pair of photos.
An instance of "Pair of photos" should be linked with two "Photo" instances which are linked with the same "Human" instance.
I tried to implement it using ER model. In this case, "PhotoPair" can…

Sh Svyatoslav
- 359
- 4
- 12
-1
votes
1 answer
SQL co-related sub-query and the case where imagination becomes unimaginable
Greetings and thanks for reading!
I am having a bit of trouble understanding exactly how co-related sub-query work and I hope to rectify this problem by asking some questions here. Please feel free to correct me if I am wrong on any instance.
Here…

user2443943
- 112
- 1
- 1
- 6
-1
votes
1 answer
Return all rows from one table and only a few from another with JOIN and WHERE
I have two tables 'projects' and 'overground' - when I run this query I get the ID from the overground value (40), not the value it holds which should be 'Forest Hill'.
SELECT *
FROM projects
JOIN overground ON…

CallMePhilip
- 7
- 3
-1
votes
1 answer
Constraint issue, values from one column need to be prefixed with values of another (different table)
Prescription table:
Prescription ID (PK)
Appointment ID FK
Quantity
Drug Name
Patient Name
Physician Name
Appointment table:
Appointment ID (PK)
Center(FK)
Patient ID(FK)
Each prescription (ID) is identified by the appointment id followed by a…

user3258494
- 33
- 4
-1
votes
2 answers
three tables relations SQL select
I'm learning SQL, so help is greatly appreciated.
I have three tables: league, player and team
league and player is many to many (as a player can be in more than one league)
team and player is many to many (as a player can be on a team in multiple…

Haymps
- 91
- 9
-1
votes
3 answers
Retrieving data from relational tables in yii framework Active Record pattern
I want to generate a report for the admin on the application. It's a small freelancing site.
I'm using Yii 1.1.14 and Mysql for the database.
I've 3 relational tables on the db from where I'd like to retrieve some datas.
I'm showing only those…

aumio
- 63
- 11
-1
votes
1 answer
Natural Join query in relational algebra?
“Any relational algebra query that includes a natural join operator can also be expressed by an equivalent relational algebra query without a natural join operator”. Is it true or false
I am on the fence with this question, I feel as though it is…

Macenbro
- 3
- 3
-1
votes
1 answer
Relational Database for Time Series Data
I am currently trying to design a database to house production test data. Each unit undergoes the same test sequence (12 tests), voltage, current, and temperature data is collected from many locations at various sample rates during each test run. …
-1
votes
1 answer
Relation Algebra in SQL
I'm trying to write a sql query into relational algebra. If I have:
Hotel(hotelNo,hotelName,hotelStreet,hotelCity,hotelState)
Room(roomNo, hotelNo, type, price)
guest (guestNo, guestName, guestStreet, guestCity)
Booking(hotelNo, guestNo, datFrom,…

Troy Griffiths
- 351
- 2
- 7
- 17