Skip to content
Advertisement

Tag: join

SQL Join using a Junction Table not returning expected results

I’m joining 3 tables in SQL Server for the purpose of mapping users to their managers. The purpose of the junction table is to map their full usernames to their network ID. Here’s the query: The first 3 columns appear as I’d expect, showing the Network ID, Full User Name and the Manager’s Full Name. However, the 4th column is

is it violate 2NF?

My table book PK ID INT pfK langID INT title VARCHAR description MEDIUMTEXT releaseYear YEAR chaptersPrice DOUBLE thumbnail BLOB Where pfk – Primary-Foreign Key; {ID, langID} – PK; chaptersPrice – price of each chapter of book. Example: BookName1: chaptersPrice=2 BookName2: chaptersPrice=3 I think in this table some attributes are functionally dependent on the part of primary key (ID): {ID} ->

Simplification of SQL Query

SQL is not my specialty. I have a working query that accomplishes what I need it to, but I know there has got to be a cleaner way of accomplishing my goal. The query should return: – Name – Date of …

MySQL Merge two queries based on mutual column

I have two queries that retrieve records from 2 different tables that are almost alike and I need to merge them together. Both have created_date which is of type datetime and I’m casting this column to date because I want to group and order them by date only, I don’t need the time. First query: Second query: What I need

Advertisement