Sample datasets for practice - Oracle pl/sql - mysql

I am a new user of SQL, I use Oracle pl/sql as a Programming software. I have done an introductory course to SQL that included some datasets. However I'd like to continue practicing, some real life problems that include requests of querying very simple statements to difficult ones that include indexes, etc.
Does anyone have any links/sites where I can further pursue SQL training for free? I've done a Stakexchange and Google search with not much luck.

As you probably know, Oracle ussually comes with some sample schemas like HR, SH... listed here
Also, you can install HammerOra benchmarking tool. It's commonly used to test TPC-C and TPC-H on different RDBMS. It will install some schemas on your DB with variable size.
You can also install some virtual appliances.
There are more there, but I think the coolest is StackOverflow DB, too bad is MSSQL.

Related

Can I connect to SQL with Node.JS without an external package, or with one universal package?

I know it may be reinventing the wheel to some extent, but I'm creating a package of my own in Node.JS where I would like to keep dependencies to an absolute minimum. This program should connect to SQL (at first, just MySQL, but eventually several different flavors, so if the same answer applies to PostgreSQL, MSSQL, etc. a note about that would be much appreciated) and be able to run queries and such. Is there a way to do so through Node without using an external package like mysql or mssql?
I do understand that this sounds very impractical, and so I see the need to use "fully debugged open-source software" as the commenter put it. However, requiring a new package for every SQL flavor I extend my program to would be impractical as well. If I must install a package, is there some sort of universal one that I can use for Node.JS (something like PDO in PHP)? If so, what is the basic way of connecting to, say, MySQL?
Thanks in advance.
Node has RDBMS-specific packages like mysql, pg, sqlite3, mssql, ibm_db, oracledb, ... all the same except where they aren't.
The php world boasts a couple of database abstraction layers that can talk to multiple makes and models of RDBMS. For Java, JDBC serves the same purpose.
The npm ladc package is a similar project for nodejs; it uses the existing packages for connecting to databases. It seems to be in an early version and not heavily used, according to its npm page.
Sequelize is an object-relational database abstraction above some RDBMSs. If you are able to use an object-relational model for your data, it's probably a good choice. If you're using lots of pure SQL, ladc might make sense.
It seems as if you're blazing a trail with your project.

SQL vs MySQL vs. SMSS vs. RDBMS

I am starting into studying SQL and am having trouble understanding the relationships between the various components.
To my understanding, SQL is a langauge (akin to PHP, JS, etc.) which is used to interact with databases.
MySQL seems to be a specific software, a specific RDBMS, but how exactly does it relate with SQL and SSMS? Is it the thing that actually stores the data, or does it simply manage them by interpreting SQL commands? I'm mostly confused on what the SSMS does then.
Any help or tips on such subjects would be appreciated, though I understand if this topic is not specific enough and needs to be removed.

How do you test a SQL statements across multiple Database types?

Does anyone know of a quick and easy test to see if a query is properly formatted for both MySQL & MSSQL. Perhaps other database types as well, such as SQL Server? I only have access to MySQL at this time.
Info: I'm working on an Open Source project called JJWDesign Google Maps for SugarCRM. Some of the queries use the SugarCRM classes; others I have to write custom. For example, some are special distance calculations against the geocode information stored in the tables.
http://www.sugarforge.org/projects/jjwgooglemaps/
More importantly, while there is an accepted syntax, each flavour of database has it's own specific functions, features and things you can do.
The best you can do is to make do with the most basic of features. Oracle has different functions for datetime compared to mysql compared to db2. While I would love to assist in a 'free as in beer' project, you really will need to check each function to see if it is the same across all major vendors. General functions most often are, so abs() will be fairly consistent, but others simply won't.
You're talking about a SQL parser so by definition it either isn't going to be quick and easy or it will do only the simplest checking.
Each RDBMS has its own flavour of SQL too so you'd really be limited to testing whether it was ANSI SQL.

DBLinq for a production system?

We're working on an ASP.NET web application with C# code behind. The database is MySQL 5.1 using InnoDB. The data access layer uses ADO.NET to call stored procedures and then builds various data structures out of the result sets (no object mapping). This works fine, but it is a little verbose.
Not surprisingly, we made some mistakes when designing the first version of our data model, but the experience has made us smarter and we decided to refactor the data model. We don't have to change our data access layer, but we are considering our options for that as well.
It's been difficult for us to ignore the popularity of ORM tools these days; we feel like we are way behind or something for not being familiar with them. Not only that, but we have already designed an object model that nicely describes our data model. The main ORM tools we would consider are NHibernate, ADO.NET Entity Framework, and LINQ to SQL. We would prefer LINQ to SQL because we have read (on S.O.) that it is more light weight than full ORM tools.
We think one drawback to using an ORM tool is the learning curve, but we can already see how using LINQ could reduce the amount of code we will have to write, which could save us time in the long run. However, we are using MySQL, not SQL Server.
So my question is, would DBLinq work well enough for a production system? Or, is LINQ to SQL a compeling enough reason for us to make the move to SQL Server 2008? Incedentally, I'd prefer to use SQL Server over MySQL, but cost is the obvious drawback. After 3 years on BizSpark, we'd be on the hook for $6K. Or, should we consider other ORM tools instead? Or, should we just ignore the hype and not use an ORM tool, but maybe take advantage of LINQ to DataSet?
I searched S.O. for info on DBLinq, but only found 17 questions with the DBLinq tag, so it doesn't appear to be popular.
EDIT
Looks at though dotConnect for MySQL has support for LINQ, so that's another option.
Can anyone speak to how well that driver works for writing LINQ queries?
Check bl-toolkit. It's free, very fast and has great LINQ support. Newest addition are T4 templates for generating your data model from database.

Developer tools to directly access databases [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I work with several different databases and find myself trying connecting to these quite often to test a query. I use the database specific tools to connect to the DB and run the query.
I find these DB specific tools like SQL Query Analyzer (SQL-Server), Oracle Enterprise Manager, MySQL Query Browser to be quite clunky and slow when it comes to running quick queries and looking at data directly. It is also hard to remember all the userids and pwds for the develop and test databases.
What tools do you use as developers to connect to the database of choice? I use Eclipse as an IDE. So any Eclipse specific tips are also appreciated.
Even if a tool were to work with one DB and not with the other, I am willing to look into it if it were more user-friendly than the one the DB vendor provides. I am already using 3 different ones.
SQuirreL, written in java, will work with any RDBMS for which there's a JDBC driver.
It works very well for both sending SQL, rendering result sets, and allowing browsing of database objects (from a tree). For several RDBMS, it includes extensions to automatically generate common statements.
Especially nice is that the query pane executes either the selected sql, or the line the cursor is on up to the first blank line. This allows you to write several statements, and to execute them either individually or in a batch.
And it's free and open source.
I've used quite a few.
PL/SQL Developer: as the name implies this is Oracle specific but is by far my favourite DB tool. It greatly simplifies import/export;
Toad: Also Oracle-specific. I used to be a big fan of this but it's expensive and I think more DBA-oriented these days. For a developer I don't think it offers all that much (given the price difference) over PL/SQL Developer;
DBVisualizer: this tool isn't bad. I'm not sure the commercial version is worth the price they're asking for it. The free version is OK. It's good that it works with pretty much any database;
Navicat for MySQL: it's OK but honestly I wouldn't pay for it;
SQL Server management Studio: comes with SQL Server. I don't think I really need much more for SQL Server than this except perhaps a better way of importing/exporting databases, soemthing for which this is garbage;
Oracle SQL Developer: this is the poor man's tool you use on Linux when you don't have much other choice. It's fairly basic but OK given that it's free.
Also a nice tool is the AquaDataStudio
I've used:
TOAD
DBVisualizer
I prefer DBVisualizer, but it's a bit of a memory hog so it might not be the right solution if your resources are an issue.
I've tried the eclipse plugins as well. For me I'd rather keep eclipse optimized to do the work it's meant to do.
When it comes to stuff like this, I prefer portable tools. Installed once, you can put them on flash or CD and carry with you. Connecting to DB should be easy as filling out usual fields: server, user, pwd..
Sql Buddy
Decent one, open source, with syntax highlighting & code completition. Not recently updated but it generally works OK.
GiPo#DB Utilities
Very nice one, has all of the above features plus its more feature filled as it was previously commercial.
Mentioned tools are not more then few MBs in size and it takes 1 minute to install them and copy them to your portable location.
Within Eclipse you can use the Eclipse Data Tools Platform for doing database development. In recent versions you can find some kind of visual query builder as well. Oracle has a plugin for DTP and implements some Oracle-specific functions.
Database Workbench can be use for Oracle - SQL Server and MySQL
http://www.upscene.com
have a look at Rapid SQL
it is a cross-platform SQL IDE that helps database and application developers produce high quality SQL code faster.Embarcadero Rapid SQL helps you increase database development efficiency by:
Streamlining SQL coding tasks, object management, reverse-engineering, source code control and schema deployment
Improving team collaboration and resource sharing
Accelerating application development cycles with code assist, Quick Fixes, SQL to Java round-trip debugging, and profiling tools
Standardizing with one tool set with deep cross-DBMS platform support
Aqua Data Studio and RapidSQL are two great tools/IDEs for sql development. You can connect almost any database engine and they include some vendor specific features for say Oracle etc..
Also since you use Eclipse IDE, you may consider Eclipse Data Tools Platform or QuantumDB plugin.
The tools depends a bit of the kind of work to do. For most browsing I go for DbVisualizer, I can customize it exactly to my needs. The support is good and responsive. For pl/sql editing I prefer oracle sqldeveloper.
DbVisualizer is not a free tool but the price is fair, maybe even cheap when compared to Toad. It is also multi database but this is implemented in such a way that I am not limited in my oracle world and it helps me navigating on other vendor rdbms that I don't know so well.
For real time monitoring DbVisualizer has a very nice option that I have not seen in any other application. VERY usable if you are trying to debug some, for example, performance problems.
Ronald
Check out RazorSQL. It has all the features of the most expensive tools at a fraction of the price.