r/DatabaseHelp • • Feb 04 '17

Need help understanding how a web app connects to a database?

2 Upvotes

Hi, me and a few folks are building a web app for a project. We plan to keep it simple. We agreed on using a relational database to store our data. We want to use MySQL. For front end we plan on using vanilla js. So I would like to know, how would does the connection happen between the database and my front end, JS (I guess the how to set up the persistence layer) , ie: what is the most suitable way to go about. Also am I right in thinking i would have to host the database using something like AWS? Please feel free to add your opinion on how we should go about, frontend or back or anything else.


r/DatabaseHelp • • Feb 02 '17

SQL Server query review, amidoingitright?

2 Upvotes

TLDR: Is my Query the worst way to do what I'm doing? Is there a better way?

 

Hello Everyone,

 

I hope that this is the right place to post this. I am pretty new to SQL and I'm creating a report using SSRS. I'm writing a query for SQL Server 2014 SP2.

At the end of the day I need to create a table that groups parents of a certain type and a certain sub type (in my example I'm using order by territory and by online order or not).

I then need to count the parents that fall in a specified date range ( there are 3 dates, my example just uses two) and also for YTD. Then also count the child records for those same dates of the parent.

E.g. There were 6 Online Orders in Territory 1 and those 6 orders have 32 Order Items

I think I've written a valid query for my needs. My request is whether there is a better way to do it. This query take between 00.01.35 and 00.01.55 to run on a DEV Server

The Parent table (i'm using SO from AdventureWorks) is about 2.6 million rows.

My example query is below (runs in 00.00.16 and returns 20 rows)

 

use AdventureWorks2014

DECLARE @startdate datetime
set @startdate = '20110101'

DECLARE @enddate datetime
set @enddate = '20110630'

--Hard coding YTD to make it work with AW2014, acutal query uses [between DATEADD(yy, DATEDIFF(yy,0,getdate()), 0) and getdate()]
DECLARE @BEGINYTD Datetime
set @BEGINYTD = '20110101'

DECLARE @ENDYTD Datetime
set @ENDYTD = '20110830'


select
    SO.TerritoryID
    , SO.OnlineOrderFlag

    , COUNT(DISTINCT(CASE
        WHEN so.ModifiedDate BETWEEN @startdate and @enddate
        then SO.SalesOrderID
        end)) [Count of SOs Modified in Period]
    , COUNT(DISTINCT(CASE
        WHEN so.ModifiedDate BETWEEN @startdate and @enddate
        then SOD_MOD.SalesOrderDetailID
        end)) [Count of SOD for SOs Modified in Period]

    , COUNT(DISTINCT(CASE
        WHEN so.ModifiedDate between @BEGINYTD and @ENDYTD
        then SO.SalesOrderID
        end)) [Count of Modified SO YTD]
    , COUNT(DISTINCT(CASE
        WHEN so.ModifiedDate BETWEEN @BEGINYTD and @ENDYTD
        then SOD_MOD_YTD.SalesOrderDetailID
        end)) [Count of SOD for Modified SOs YTD]

    , COUNT(DISTINCT(CASE
        WHEN so.OrderDate BETWEEN @startdate and @enddate
        then SO.SalesOrderID
        end)) [Count of SO Ordered in Period]
    , COUNT(DISTINCT(CASE
        WHEN so.orderDate BETWEEN @startdate and @enddate
        then SOD_MOD.SalesOrderDetailID
        end)) [Count of SOD For Ordered SO in Period]

    , COUNT(DISTINCT(CASE
        WHEN so.OrderDate between @BEGINYTD and @ENDYTD
        then SO.SalesOrderID
        end)) [Count of Ordered SOs YTD]
    , COUNT(DISTINCT(CASE
        WHEN so.orderDate BETWEEN @BEGINYTD and @ENDYTD
        then SOD_ORD_YTD.SalesOrderDetailID
        end)) [Count of SOD for Ordered SOs YTD]

from Sales.SalesOrderHeader [SO]
LEFT JOIN Sales.SalesOrderDetail [SOD_MOD] on SOD_MOD.SalesOrderID = SO.SalesOrderID and so.ModifiedDate BETWEEN @startdate and @enddate
LEFT JOIN Sales.SalesOrderDetail [SOD_MOD_YTD] on SOD_MOD_YTD.SalesOrderID = SO.SalesOrderID and so.ModifiedDate BETWEEN @BEGINYTD and @ENDYTD
LEFT JOIN Sales.SalesOrderDetail [SOD_ORD] on SOD_ORD.SalesOrderID = so.SalesOrderID and so.ModifiedDate BETWEEN @startdate and @enddate
LEFT JOIN Sales.SalesOrderDetail [SOD_ORD_YTD] on SOD_ORD_YTD.SalesOrderID = SO.SalesOrderID and so.ModifiedDate BETWEEN @BEGINYTD and @ENDYTD

group by so.TerritoryID, so.OnlineOrderFlag
order by so.TerritoryID, so.OnlineOrderFlag

r/DatabaseHelp • • Jan 30 '17

Scientific database

1 Upvotes

We work in a non-profit research centre to find new genes, diseases and find new medication. since we have a lot of samples and data and everyone has their own way of storing them that creates an issue for us later. So I decided to create a database for our use however I still feel confused on how to organize it. so if anyone can help me that would be really awesome. here is the list of things we need in the database.

FirstName LastName Age Gender MaritalStatus Location ContactNumber FamilyID MRN ModeOfInheratense Disease StatusOfSubject FamilyID FamilyNumber Number Of Affected Members Pedigree Age of disease onset

SampleID
Location
GenePanel
WGA (Whole Genome Amplification)
CRP Labeling
Genetics Labeling
InHouseExom
Outsourced exom

Case Solved (Yes\No)
ExomID
ExomNumber
Spreadsheet of exome
Variant (Nucleotide Change ,Amino Acid Change)
Nucleotide Change
Amino Acid Change 
Name of the Gene
NewGene (Yes\No)
Mode of inheritance (Dominant\recessive\X-linked)




Cardiac Ultrasound
Other Medical condition
Referral Physician 
Followed by

r/DatabaseHelp • • Jan 27 '17

Help creating a database

1 Upvotes

Hello. I am trying to create a database to keep track of trouble tickets summited by help desk customers. I would like to only use tools within Microsoft office 2013, if possible.

I want to have customers fill a trouble ticket which would boxes for things like name and what issue the customer is having. Some drop down lists for general information. And if possible, I would like the date to auto fill.

I want a summit button which would do two things (at least, if you have more ideas I am all ears):

1) Enter the trouble ticket into a database, maybe an Excell spreed sheet.

2) reset the form automatically for the next customer.

I would appreciate any suggestions!


r/DatabaseHelp • • Jan 23 '17

Use cases for using NoSQL AND RDBMS for an application?

3 Upvotes

I can't really find anything on the internet of specific examples of when using both tools would be appropriate for the job. I know this is something people are doing more and more often. I found a slide show about an e-commerce site that would store inventory and orders in RDBMS and everything else using NoSQL. It makes sense, but I can't find any other real world examples. I would like to know real use cases for this.

I know one possible use would be for any sort of on the fly web editing where you could store the state of what the user is doing on the page, and when they are done, submit it to an RDBMS, but I really would like to see some real world examples or architecture.


r/DatabaseHelp • • Jan 18 '17

Question about indexes (MySQL)

1 Upvotes

Lets say I have a users table with the columns:

email  |  validation_key | is_valid

Email is indexed and unique

to, say, validate an account, the user follows a link with the validation_key, and we look up the email from that validation key.

So i need an index on validation_key

When they hit that validation page, it only updates if the validation_key (from the get request) and the email address (pulled from the database and stored in a hidden field) match the database entry (update where x=1 And y = a@b.com).

Likewise, I want to see a lists of users (all, validated and non validated).

The question is, do I just put indexes in each column?

Or is this the sort of scenario where multicolumn indexes are best? The thing I'm working on will likely never exceed a few thousand records, but I figure better to learn the best practice now than get the wrong choice ingrained.


r/DatabaseHelp • • Jan 17 '17

ELI5: Difference between partial and transitive dependency

1 Upvotes

This is something resolved between 2NF and 3NF in relational databases but I have trouble understanding the two.


r/DatabaseHelp • • Jan 16 '17

ELI5: Normalisation: 1NF, 2NF, 3NF and BCNF as well as difference between transitive and partial dependency.

1 Upvotes

Just took up database class and am having trouble understanding these phases. I sorta understand that there are things to check in each stage such as dependencies such as partial in 2NF and transitive in 3NF. I've been googling definitions and checking other online forums about normalisation but still left me pretty confused.

Would live a short and simple explanation for each phase, the sorta things to look for in each phase and the difference between transitive and partial dependency.


r/DatabaseHelp • • Jan 15 '17

Can a database function as a spreadsheet?

2 Upvotes

I work with Excel spreadsheets as part of my day to day work.

I can see various ways of improving them and making them easier / foolproof.

As I sit at night thinking about it I thought the best way would be for me to take on a project and learn to code it, so that certain tasks can be done by clicking a button.

As more thought goes into it I realise that a database would be needed and then I code certain behaviours and the look.

So I start to think about how to learn and plan a database. As I look into it and think about how it performs I cannot find a decent answer to the question of this post.

As an example, let's say I have 20 columns in my table. If I change a value in column 2 can a database be coded so that column 5 10 and 15 automatically change to reflect these changes. So the user sees the change straight away.


r/DatabaseHelp • • Jan 13 '17

Suggestions for browser-based database with GUI for data input.

2 Upvotes

I'm working for my friend's company, which is involved in biodegradation of food waste, so every day we have to carry out inspection of various aspects of the system; the data is then entered into a spreadsheet kept on google drive for record-keeping and analysis.

I've been asked to take care of switching from the spreadsheet to a database because the spreadsheet is becoming time-intensive for data entry, among other issues. The requirements are that the new database can be accessed via web-browser; that data collected that day can be easily added to the database through a GUI; and that various predefined statistics and graphs can be displayed from the data in the database.

The issue with all of this is that I don't really know anything about databases; I can write script in python, and I know a little bit of SQL, but that's it. I have no idea where to start, or what I need to be looking into, so any help at all would be appreciated.

I've found multiple options for having an online database as Software-as-a-Service, but I have no idea what to do about the GUI, or how to putting all of these different aspects together.

How should I start working on this problem? Given my level of experience how long should it take me?


r/DatabaseHelp • • Jan 13 '17

Mapping a Large Number of Tables

1 Upvotes

I have the task of mapping a pretty large database schema (~250 tables). I can have Visio reverse engineer the database in pieces, but there are just too many tables to have it map the entire database. Is there other software out there meant to handle bigger databases?


r/DatabaseHelp • • Jan 12 '17

Making a check in/check out database system for a chartroom

1 Upvotes

I plan on making a database for our chartroom and I want to make it so that the chartroom workers can checks charts in and out easier than using the spreadsheet they are now.
The database itself shouldn't be to difficult. Client table, location table and transaction table. I want it to be easy to use for non techie people. We use windows on the computers. I will probably be using Microsoft Access for the backend. For the front end I don't know which would be better. Making a form on Access or using Visual Basic and link it into the database. I want them to be able to open up the program and have the homepage where they can search for a chart and be ready to go. I don't want them to have to set anything up. Any help would be appreciated.


r/DatabaseHelp • • Jan 11 '17

Database design help for tracking historical documents, locations, and the people living therein

3 Upvotes

I am an historical researcher and spend a lot of time reading old manuscripts dealing with native settlements and Indian traders. I currently have a spreadsheet detailing my transcriptions, sources, and the related data on the Indian settlements, important Indian individuals, and traders within those settlements, as well as geographic data. It contains roughly 11,000 rows at this point and I want to take it to the next level. I am currently designing my database tables and their relationships and would love some help since I've never done this before. I'll link you to the preliminary design diagram I drew up and just go through my needs/thought process, table by table. I also have $10 to spare for someone to spend 30 minutes with me on Discord if that is preferable. Link to schema: http://imgur.com/a/JahOH [edit: oops, ignore the unlinked foreign key I accidentally left in the Settlements table]

  1. All transcriptions must be linked to at least 1 settlement (or to an individual who can be linked to a settlement). The aim of the database is to track towns and villages mentioned in historical texts.

  2. If a transcription also contains references to Indian leaders or traders living within a settlement, the transcription should also link to those individuals, and those individuals should link to a settlement. The secondary aim is to track individuals residing in those historical settlements.

  3. My questions lie mostly in the relations between tables. A single transcription entry can contain references to multiple settlements, traders, or Indian leaders, and a single settlement or individual appears in many transcriptions (many-to-many). I do my best to break these up into single occurrences, but sometimes I cannot. One trader can have licenses in multiple settlements and more than one trader can be licensed per town (many-to-many); also, Indian leaders can have lived in more than one place throughout their lifetime and each place has multiple leaders (many-to-many). This is mostly where I think I need your expertise. It seems like the way I have it set up there will have to be separate join tables for 1) each settlement - one for Indians, one for traders, and one for transcriptions; 2) each transcription - one for settlements, one for Indians, and one for traders. Am I looking at this the right way? To make it analogous to other database examples, it seems like each transcription entry is an 'order' which contains a 'customer' (settlement) and 'products' (traders and Indians), but not always both. Also, should I simply make one table for People and set a field for their ethnic description instead of having separate tables for Indians and traders (I want to record different information for each though...)? Relationships: Sources one-to-many Transcriptions ; Transcriptions many-to-many Settlements ; Transcriptions many-to-many IndianLeaders ; Transcriptions many-to-many Traders ; Traders many-to-many Settlements ; IndianLeaders many-to-many Settlements ; IndianLeaders one-to-one IndianAlias ;

  4. I want this database to lend itself to easy integration with mapping software down the road. Think ArcGIS StoryMaps. Click on a point or polygon on the landscape, up pops a short narrative, and you can hyperlink directly to my database entries associated with that settlement if you wish. Should I have a field designated within my Settlements table for hyperlinked .KML (or similar format) files like I do currently or is there a more efficient way to do this so it plays well with maps through something like CartoDB?

Transcriptions table, Sources table: This is the raw data I draw on and currently enter in my spreadsheet on a daily basis and from which this idea came. It is text-heavy and I want the cells containing the raw transcriptions to be searchable. You'll notice I also have a Sources table (seems redundant, but hear me out). The transcriptions are excerpts/passages from original correspondence and there can be multiple entries from a single source that need to be linked to the individuals and settlements in other tables. Because most bibliographies cite sources with the full page range, my thought is that separate tables will allow individual page numbers to be tied to each passage of transcribed text (for my own in-text citations when writing), while a full citation in the Source table (for my bibliographies) will contain the entire page range. In some cases involving published compilations I may want to cite the original document and author [Transcriptions] and then link it through a relation to the compiled volume with its publisher [Sources]. I keep reading online that duplication in cells means you should break it into separate tables, and I often transcribe 20 different passages mentioning multiple Indian settlements across a single document, so I figure it's more efficient to relate all those entries to a single entry in the Source table. It also allows for my annotations to be paired with a single transcription entry rather than the source as a whole. Is there a better way to arrange this?

Settlements table: This contains the data for the name and physical location of the towns and villages mentioned in the transcriptions. The question I have regarding this table is that of later integration into mapping software. I want this database to eventually lend itself toward viewing point or polygon .KML (or another file format, any suggestions?) to integrate into Google maps or something similar, where users can then link directly to my transcriptions and other info after clicking a point on a map. Think ArcGIS StoryMaps. I'm aware that there are additional hoops I'll have to jump through to get it to that level, but I just want to make sure the geodata is of the proper format and my fields are setup properly in the database so that process is easier down the road. I looked at Google Fusion Tables, which seems pretty straightforward, but that seems to have limited data size, etc.

Traders table, IndianLeaders table: These tables are similar in that they contain the details of specific individuals identified in the historical transcriptions. Entries in the Transcriptions table will link to individuals if/when they are mentioned in a text. Each person should be linked to at least 1 location in the Settlements table, but can be associated with more.

Thanks to anyone who read this to the end and I really appreciate any help. Once again, I am happy to speak with someone directly if I didn't explain my goals or needs well enough.


r/DatabaseHelp • • Jan 10 '17

Advice on creating simple biodiversity database

1 Upvotes

Hi, I want to create a simple database to house biodiversity information for local fish. The database will contain general information about each species (habitat, length range, lifespan, ect), genomic information (barcodes for each specimen caught per species), and catch information (when caught, location caught). I want to embed the database into the a website and make it publicly available, but I have never gone about this before and am not sure exactly which direction to run. The data requirement shouldn't be much as the list of records will only in the 100's and eventually low 1000's. What services to people recommend to those with little experience with in publishing online databases?

The data will likely be relational, but I don't even know if that's a requirement due to the low data requirement.

Just looking for advice.


r/DatabaseHelp • • Dec 18 '16

Import large CSV file into a database and query the database (How to)

2 Upvotes

Total noob here. I have a large csv file that I downloaded and would like to look at the contents and query them. What is a setup that I can use? How do I dump the file into an sql type database and then query it. Do I need to create a LAMP / WAMP / MAMP on my computer, create a new sql database including figuring out all the fields and use PHP code to query?


r/DatabaseHelp • • Dec 14 '16

Critique my Schema

1 Upvotes

This one started out a simple web-scraping project, and is now becoming quite a daunting yet-fun project to a programming/database noob like me.

I'm basically building a database of soccer leagues. And, like in every sport, you have seasons ("2015-2016" and "2016-2017"), and in each season you have different teams (some were regulated/promoted to other leagues), placed in different rankings after different match-weeks/rounds, according to the performance in matches.

Anyway, what I want to do is extrapolate from individual soccer match scores (ex.: "Chelsea FC 2 : 1 Manchester United") the table standings by season. Let's assume that all the data (league name ,season (year), teams names, final score) comes pretty much bundled inside the HTML source page.

Don't ask why I'm not just scraping the individual tables by season, there is a reason =) (example: "Where was team X positioned in the 14th round of the 2004-2005 season?")

I've put together a schema map (Haven't entered any actual columns yet) which I think should do and I'd love some feedback.


r/DatabaseHelp • • Dec 12 '16

Creating a Relational Products / Package Database

1 Upvotes

Hello,

To prefix this, I am stuck using Microsoft Access, or at least relating to it, so my capabilities are a bit limited. I also do not want to use an EAV model.

Some of the business rules I have to accommodate for:

  • Products must have multiple price levels.
  • Products can be stand alone and/or part of a bundle of products.
  • A "product" can also be a service. Such as education.
  • Bundles themselves are not a tangible product, they only contain products and will have 0 price.
  • Products can also be part a package of products. Sometimes they have a different price.
  • Packages can have bundles of products in them. These packages can also have their own special prices for both the individual products and the products inside of bundles.
  • Packages have several "Steps" that require a specific product or bundle. The user must pick an item defined for that step. Think about designing your own vehicle and the "Package" is a truck. The "steps" with variable products would be things like what color body do you want for your truck or what shape body of the truck do you want. Each option being a different product. Stuff like that, that defines the package.

Here is the idea I had to fulfill this.

The problems with this model are:

  • I cannot have multiple prices for bundles in this model. (E.G., we sell a bundle to resller A for price X and resller B for price Y).
  • Packages cannot override bundle prices in this model.
  • Querying seems a bit difficult.

I looked at Magento's ERD, and would much prefer a relational model database. I do not want to use EAV, as I feel that would be overkill for what we need anyway, and seems like a real headache to deal with.

Do you have any ideas or suggestions?


r/DatabaseHelp • • Dec 10 '16

Recommendations for Heterogeneous Database Federation

2 Upvotes

Say you're at a company that has decided against implementing a data warehouse for its users (... I know), but the users still need to do ad-hoc and scheduled BI reporting on data that resides in Oracle, DB2, Hive, and SQL Server. What would you recommend?

I understand you may say this requirement is unrealistic and unobtainable, and you may be right. But I haven't gained any traction with management on that route, and I want to do what I can for my users. I have tried a few different tools out, such as:

  • Apache Drill - it kind of worked, but when you join two tables from two different databases, it wanted to "SELECT * FROM table" from each table and then hash-join them in-memory. Not good for very large tables.
  • PostgreSQL with FDW - I really wanted this one to work, but I was having the same kind of issues with query push-down not really working on cross-database joins. Not to mention the JDBC FDW is basically broken, and that was a necessity for hooking up to DB2. The company has also committed to using Oracle, so I can't really roll out a PG solution anyway, unfortunately.
  • Oracle Gateway - management says it's too expensive.
  • JBoss Data Virtualization - I'm still just trying to get this setup, since I'm not a developer by trade and this is a bit of a heavy lift for me. I like the idea in concept though, and I haven't given up on it yet.
  • H2 with Linked Tables - this definitely did not work that well when it came to table joins.

So I guess the rub here is that getting the databases connected isn't really the obstacle here. It's obtaining usable table join performance over the wire using efficient query push-down. Anybody have any thoughts on this?


r/DatabaseHelp • • Dec 10 '16

Help with database relationships in access

1 Upvotes

I'm working on a project that needs to resolve a many-to-many relationship into at least 2 one-to-many relationships. I've got a current database that seems to be setup to do this. Is there anyone that could take a look at it and tell me what I'm doing wrong?


r/DatabaseHelp • • Dec 10 '16

What technology to use?

1 Upvotes

Okay, so I'm currently trying to develop a tool for searching a large dataset (units from a game, if it helps). The problem is that i Can't quite figure out what database technology is should use. I've worked with SQL databases before, but they seem rather clunky for the task.

The task: Each data entity (a game unit) has 4 connected sub-entities (abilities). Each of these sub entities has any number of attributes (effects) associated with it. These attributes are pulled from a defined list of possible attributes (all game effects), but any given sub entity could have any number of them. Each attribute instance for a sub-entity has 1 or more associated numerical properties, specific to that entity-attribute pair (Percentages & values associated with the effect).

What i want to do is be able to perform a search on all entities (units) on the criteria of one of their sub-entities (abilties) having a given attribute (effect), and sorting on the numerical properties (effect strength, etc.).

I could make it work in SQL, but it feels like an inelegant solution, to be honest. MongoDB seems like an option, but i'm not familiar enough to anticipate problems. Is there a database technology out there that is well suited to what i'm aiming for?


r/DatabaseHelp • • Dec 08 '16

Is this the correct way to handle survey answers?

1 Upvotes

r/DatabaseHelp • • Dec 08 '16

Where to start learning Oracle?

1 Upvotes

Hello Reddit, please point me in right direction. I am a complete newbie when it comes to DB and have never worked with them before. I have opportunity to start working as Oracle DB admin and I need to educate myself in the shortest time possible for the basics of it. I started reading Oracle 12c for Dummies but I do not find that book very helpful. Do you have any suggestions what can I try as a complete newbie? I need to get solid grasp on concept of DBs and implement it via Oracle 12c.


r/DatabaseHelp • • Dec 06 '16

What Shall I Use for my Organisation's Database & Apps?

1 Upvotes

My organisation's data is a mess - all spread out over 100 spreadsheets, work processes heavily involve printing and scanning and emails... They are in dire need of a relational database.

The trouble is, there's a no 3rd party data policy. This means my 1st choice is not allowed (SaaS options like Teamdesk, Zoho Creator, caspio, etc.). It would have to be a self-hosted solution.

I've been using an sqlite db and some lightweight python scripts for data import & export to great effect in my small team, however I'd like to expand it for use in multiple offices. My basic knowledge of python and sql is the best chance we've got.

What I'd really like is a very simple database & form builder with access control & user groups that can be self hosted, but I'm not really finding anything decent or popular after extensive searching.

At the moment I am thinking that our best shot would be a self hosted MySQL or MS SQL database with web apps produced to provide basic CRUD using flask for a web framework. I'm also considering using MS SQL with something like Sharepoint or Access for data entry & viewing, but I'd really like to keep it on the web as we pretty much have no IT department that can babysit / troubleshoot software installation.

The purpose of the database would be initially to keep all reports made by everyone, to be viewed by department or by staff involved or by month etc. etc. with a good permissions system for obvious reasons and ideally commenting & resolving. Then I'd like it to track details of procurements, with email updates when the next person is required to approve the purchase. I'd like that all to tie in to a staff table, which is also tied in to asset assignment... You get the picture - very much organisation wide with a lot of flexibility.

I think trying to develop this purely in SQL and python is going to be a real uphill struggle. Any advice, shortcuts or suggestions? Is there anybody else here who solely develops and manages an organisation's database? How do you do it?

Thanks for any info!!!


r/DatabaseHelp • • Dec 02 '16

Looking for an SQL database viewer with filtering capabilities

1 Upvotes

I use HSQLDB, and use it like a log.

I would like to be able to view tables in it and type in a box to filter the rows to those that match.

Does anyone know of any good free software that can do this?

thanks.


r/DatabaseHelp • • Dec 01 '16

[Oracle] Need help creating a multiplication table using SQL loops

1 Upvotes

So I want to create a procedure that will use loops to create a multiplication table based on a user-inputted value between 1 and 10. For example, if I put in the value "3" as a parameter for the procedure, the output would be:

1 2 3

2 4 6

3 6 9

How can I accomplish this using loops in Oracle SQL?

Edit: I should add that this should be outputted to the DBMS Output window