FAQ Database Discussion Community

Struggling to wrap my head around this Database Query

I am completing Stanford's Relational Algebra course and am having a hard time understanding one of the questions, although I have got the answer. Here is the schema: /* Delete the tables if they already exist */ drop table if exists Person; drop table if exists Frequents; drop table if...

Creating relational matrices with R

My dataframe consists of projects with the different individuals that took part in it, as well as the year in which projects were carried out. How can I create, for each year, a nxn relational matrix (n being the number of individuals) that counts the number of collaborations between individuals....

Database Design Relational Algebra query

I have this schema: Suppliers(sid: integer, sname: string, address: string) Parts(pid: integer, pname: string, color: string) Catalog(sid: integer, pid: integer, cost: real) And this task: Find the sids of suppliers who supply every part. What I don't understand is why in this solution we don't work with a negation. I...

XSLT remove data if attribute value is higher than threshold

I am newbie to XSLT. My am is to remove elements from XML based on a field if it is higher than some threshold value which I will be getting as parameter to it. My XML is as shown below: <tns:PM objectClass="MyNode" objectName="" className="com.project.converter.PMFamilyConverter" interfaceName="ComponentPM" xmlns:tns="http://www.myproject/SS/PMSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.myProject.com/SS/PM.xsd"> <tns:family desc="family0"...

What does colon means in relational algebra

I am studying relations and trying to understand the following sentence: So what does t: R means? T is a tuple. I looked up the use of colon but couldn't figure out the meaning in this context.. Can someone please help to translate the sentence into plain English? Thank you...

How does `std::less` work?

Pointer relational operators do not define a total order (ยง 5.9 of the C++11 standard): If two pointers p and q of the same type point to different objects that are not members of the same object or elements of the same array or to different functions, or if only...

EER diagram with mandatory sub-classes to SQL tables

I am working on an assignment to create a database for fast food outlet and am stuck with generating a relational schema from my EER which has mandatory subclasses. I have a CustOrderDetails(OrderNo {PK}, EmployeeNo, DiscCode,....) entity with subclasses DeliveryOrder(CallStart,...) and PickUpOrder(PickUpName,...). These are "Maandatory/Disjoint" so CustOrderDetails MUST be one...

Do relational operators like less than, greater than, gte, lte use type conversion in PHP?

Do relational operators like less than, greater than, gte, lte use type conversion? If they do, why are there no strict comparison relational operators like !== or === ?

How to have multiple rows reference the same field of a single row?

I'm new to PostgreSQL and forming relationships between tables. I have a jobs table and an items table. The jobs table has a shipping_date. I would like the items table to have a column that reflects the shipping_date of the jobs table: jobs table: job_id | shipping_date 10001 | 29-06-2014...

Find the sids of the suppliers who supply every part

3 tables: Suppliers(sid, sname, address), Parts(pid, pname, colour), Catalog(sid, pid, cost) The answer to find all the suppliers who supply every part is: SELECT C.sid FROM Catalog C WHERE NOT EXISTS ( SELECT P.pid FROM Parts P WHERE NOT EXISTS ( SELECT C1.sid FROM Catalog C1 WHERE C1.sid = C.sid...