effective-sql's People
Forkers
richardbroersma rishi-java-123 wakematta dazonipse cyrustse jameskrauser why-not-sky coderjiav duanshuaimin stefcab ferguske srinivasdhulipalla kmkmkkball spruwacz wjwang jerrychlee kensuke k-nii0211 jrasik gferter abbyf samwutw akoranteng hgs1906 daviddcraig shaing ilyanab peizihui bluenine99 nareshkanduru chuvanan gridl haxiaocao juancrg90 chinweilu chyren0305 peter--barnes bradleylt seesawin xiang-lawrence hungnguyengoc xinxintang tx991020 gssali foeinlove evrimulgen ziyunie mmarich1 lifeng930 cardinalred jerrylin0 marcwontorek dabochang krzykarzet brodriguezv tkt9k2562 njxmlu stevencarousell xuda18 ming-fork kamyu104 wilbeibi depeng414 mintonmu wjunicorn alexfang2016 feiyafei624 kinakomotitti shrikeshpandey superdba111 paulmcquad jackshen14 liyutao-gb victorray84 datamenace wpbawsed jokerlaughter nicholasjhenry mgargadennec gaborstefanics pangxixin jqmtony joeng165 maxsad1 adongadong weigu520 kongshuaifu mdjsxy111 thien1311 luismjimenez khwajajalal seanreed1111 happyabbi kthure01 stefanafairman alvarofedez revfeng kyle8615 justinrchou clandaeffective-sql's Issues
PostgreSQL - Listing 2.008.sql - ERROR: relation "customers" already exists
The CREATE TABLE statement in Listing 2.008.sql throws an error since it is already created in the SalesOrdersStructure.sql file. Other listings are either commenting out the create table statement or they are commenting that the CREATE TABLE statement will throw an error.
Dependency to BowlingLeagueStructure.sql
Consider adding comment for dependency to BowlingLeagueStructure.sql.
Listing 4.015.sql - No Rows
Neither query supplies produces any rows in the result set.
Dependency to Item19Example.sql
Consider adding a comment in Item19Data.sql.
Dependency to EntertainmentAgencyStructure.sql
Consider adding comment to dependency in EntertainmentAgencyData.sql
Last GROUP BY clause in Listing 5.015.sql
In PostgreSQL Listing 5.015.sql, I think the last GROUP BY clause can be omitted becasue the subquery is restricted to a single CategoryID.
SELECT C.CategoryDescription, P.ProductName,
SUM(OD.QuotedPrice * OD.QuantityOrdered) AS TotalSales
FROM Products AS P
INNER JOIN Order_Details AS OD
ON P.ProductNumber=OD.ProductNumber
INNER JOIN Categories AS C
ON C.CategoryID = P.CategoryID
INNER JOIN Orders AS O
ON O.OrderNumber = OD.OrderNumber
WHERE O.OrderDate BETWEEN '2015-10-01' AND '2015-12-31'
GROUP BY P.CategoryID, C.CategoryDescription, P.ProductName
HAVING SUM(OD.QuotedPrice * OD.QuantityOrdered) >
(SELECT AVG(SumCategory)
FROM
(SELECT P2.CategoryID,
SUM(OD2.QuotedPrice * OD2.QuantityOrdered)
AS SumCategory
FROM Products AS P2
INNER JOIN Order_Details AS OD2
ON P2.ProductNumber = OD2.ProductNumber
INNER JOIN Orders AS O2
ON O2.OrderNumber = OD2.OrderNumber
WHERE P2.CategoryID = P.CategoryID
AND O2.OrderDate BETWEEN '2015-10-01' AND '2015-12-31'
GROUP BY P2.CategoryID, P2.ProductNumber) AS S)
ORDER BY CategoryDescription, ProductName;
BowlingLeagueStructure.SQL missing identity keywords for SQL Server
Database: SQL Server 2017 - Express.
I needed to add "IDENTITY (1, 1)" to the ID columns for the Bowlers, Teams, Tournaments, and Tourney_Matches table definitions for the data query to insert without errors.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.